Fade lights --- Only if not turned off?


#1

1) Give a description of the problem
I’ve got a piston running now that fades my outdoor lights… I like it a lot because its nice to have lights on but dim late at night. I have an automation that turns off some of these lights when we go to sleep… so if we turn in early, the automation turns off the light, then piston dims to 38% and then the automation again turns off the light… this will go on until the dimming is scheduled to end. Its a rare problem mainly in these summer months

2) What is the expected behavior?
The piston is performing as expected, but I’d like to cancel the dimming if the light is manually turned off or turned off from another automation


#2

First thought is if the lights are always going to be at 50% level when you want to start the fade, then you can test for that as a condition before executing the fade task.


#3

but what if the fade gets interrupted with an OFF command? Is there a way to abort the fade?


#4

I don’t believe there is a way to cancel a fade task in webcore which is why I avoid long fades. Do a search on it in the forum just to make sure.


#5

I see this, I will give it a try… although I might need to put each light in its own piston.


#6

One workaround is to have another piston that can be triggered by a virtual switch to pause the fade piston and resume it after a few seconds. A little kludgy.


#7

I thought webcore has a cancelTasks command.

So it seems you could catch the off command and cancelAll.

Given you are using multiple devices, this would cancel the fades for all of them for just one of them being turned off, so other logic would need to deal with they are in different states…


#8

I am going to try the ‘cancel all’ from the example I posted. I realized that I only have one of the lights go off from another automation because it is close to the bedroom, so I am going to see if cancel all then dim the other two will fix it.


#9

Looking at the code, I’m not sure cancel all stops the device repeat functions.

Seems like webCoRE needs a command to do that.

Are you running on ST or HE?


#10

I am on ST


#11

Yeah, I believe the cancel all pending tasks didn’t apply to the webcore simulated fade task.


#12

The cancel seems to work fine, but it kills the entire piston… so finishing the fade of the remaining lights as I attempted did not work.