Fade Cancellation


#1

Few things in webCoRE seem to be as stealthy or unstoppable as a “fade to level” once it has begun. I’ve tried to write a few pistons around it and have been part of many threads in “Piston: Design Help” with the same issue. All the usual suspects have been tried, but come up short when it comes to stopping a fade:

  1. Cancel all pending tasks
  2. If $systemVariable is, then Do xxx… all system variables seem to be null, including $currentEventAttribute when the piston wakes up to set the next level. Success using this method would seem to still be limited by item #1. If you can ID a fade command woke up the piston, how could you stop it?
  3. Piston pause - this CAN work, but requires a separate piston to monitor and resume the offending piston. Since the name of a piston to resume can’t be passed as a variable or argument, the piston doing the monitor/resume function has to be hard-coded with a piston name to resume. This stacks up pistons quickly depending on the number of times you use fade in other lighting applications.

The most common need for this comes about as “if my automation has started a fade, and someone adjusts the light with a switch, I want the automation to stop further adjusting the lights”.

As someone that was travelling for work and 10.5 hours ahead of my home time zone, bored, and playing with the automation… and may have inadvertently started a fade from 0 to 100 command on the Master Bedroom lights at 1:30am… I can speak to how much any kill for Fade to Level would be appreciated. :slight_smile:


Help with Daily Routine- Dim On/Off & Cancellation
Trying to get my head around the Task Cancellation Policy options
Trying to set up an interrupt
Light Timer Efficiency
#2

I agree. I’ve never been able to successfully cancel a light fade.

I finally adjusted my fades to 10 minutes so if I need to cancel I can usually just wait out the 10 minutes. :unamused:


#3

Same here, I’ve tried everything (I could think of) to kill a fade, never got it to work.


#4

I, too, would love to see a solution to this exact problem - cancelling a fade.


#5

I’m here as well. Called off work today and can’t stop my gentle fade. Might as well go in!


#6

Add me to the list! I have a wakeup routine that fades up a number of lights including one on my nightstand. After triggering it yesterday morning I decided to sleep in so I told my nightstand lamp to shut off and I rolled over. A second later it came back on and continued its fadeup…

I’ve attempted a few different things to stop the fade but nothing has worked. I did a search and came across this thread of posts.


#7

Same here. As a solution that I have not done yet, I plan to experiment with doing a manual fade with a virtual switch in the loop that would allow gracefully cancelling it if I wanted to.


#8

I use the fade action to set my house lights to an appropriate light level before sunset however if we try to manually change that light level during the fade the fade will override what we set it to.

Can we please get a method to cancel the piston or fade action?


#9

I’'m going to ask for this as well. Currently I’m doing my fading manually by doing a 30-second timer that keeps getting called, which seems a bit expensive in terms of webcore server load.


#10

I’m surprised this hasn’t been acknowledged or considered for a future update. Seems simple enough and makes the fade feature less likely to be used.


#11

I agree totally. Currently, I limit my fades to under 10 seconds so as not to cause any issues…


#12

I’m not seeing signs of webCoRE adding support for cancellable fades, so I suppose that I may need to go with a manual fade for the time being.

Does anyone have a generic light-fading code snippet that they’d be willing to share? Ideally, I might be looking for something that calculates the per-loop-iteration wait time dynamically based on the desired overall fade duration (rather than, say, a hardcoded per-loop-iteration wait time).


#13

I actually found a workaround… Not ideal what so ever BUT it works…
I created 2 pistons for testing…
PISTON #1
Turns the lights ON
Waits 5 seconds
Fades out to zero in 30 seconds…

PISTON #2
When triggered PAUSES piston number 1
Pausing the piston CANCELLED THE FADE OUT…
ANd resuming the piston BACK Won’t restart the fade out…

Hope this helps…


#14

Oh, that’s a good find, @ike2018!

Out of curiosity, if you pause and then immediately resume piston number 1, is that all there is to it? Or does one need to wait a certain amount of time within piston number 2 between when you pause and then resume piston number 1?


#15

Well nothing really happens in a second in webcore and/or ST HUB (Cloud stuff)
I never tested how fast it would be (Pause and resume)

But let me test…
Be back in 5 :slight_smile:


#16

Interesting…
paused piston never even registered paused, it just remained active…(probably web interface stuff)
But fade stopped immidiately… so it works…

My pause resume piston was this:
IF switch X changes to ON
Pause piston A
Wait 1 second
Resume piston A

that’s it…so it was really fast…

But FYI i’m not advanced enought to know about webcore’s structure etc…
So if anyone wants to comment on this workaround please do so, I don’t know if this fast pause-resume effects something negatively?


#17

The Dashboard updates every ten seconds, so it likely resumed before the update. (which is why you did not see it paused)


I try to avoid using Pause/Resume on working pistons, because when it is paused, it is 100% dumb. It knows nothing… Sees nothing… Controls nothing.

Depending on your code, the pause/resume may break other parts of the code. Perhaps, if you must pause/resume, only do it on pistons that do nothing but fade.


#18

Just out of curiosity—I take it that your pause/resume piston doesn’t happen to work if you were to omit the wait altogether?

And for @WCmore or for anyone else who might do so—do you happen to work around webCoRE’s lack of fade cancellation by going the route of using hand-coded manual fades instead? And if that might be the case, would you perhaps be open to sharing such a code snippet?

And thanks bunches for your insights and experimentation with all this, @ike2018 and @WCmore. It’s much appreciated!


#19

You mean something like this?
Pause piston A
Resume piston A

No “wait”…
himmmm I haven’t tested this but chances are really high that resume part might not work. But alway, best to test:)


#20

I agree. If your piston needs to do stuff AFTER fade in/out is done, it won’t be able to do it. So if it’s a simple piston then it should be fine.