Interrupt/Stop/cancel a piston from another piston


#1

Hi,

Is it possible to stop the execution of one piston from another piston?
I’d like to interrupt the execution of a piston, if another piston fires up.
I can do it using if condition and veriables, but it won’t stop it if its in the middle of executing a “long” action like slowly dimming and turning off lights. only after the action is done.


#2

I would love to see some examples as well…


#3

examples?
I have two pistons:

  1. turn lights on if motion detected
  2. slowly dim lights + off over course of 60 seconds if no motion for 5 minutes.

what happens is, when the lights starts to dim, and motion is detected, the lights turn full brightness, but then continue to dim.
In that situation the dimming piston needs to be stopped.


#4

Ahh yes… What I meant is, I would love to see some examples of how to stop a fade.


#5

I did some testing with a 20 second Fade level action and it did not seem like any special settings were required to cause the Pause Piston action triggered from a different piston to interrupt the fade. Is it possible that there is a device-specific fade command being used where the device takes the command from webCoRE and then performs the fade itself based on the specified timing?

Edit: I guess you were not explicitly asking about pause and resume but maybe this is a solution to pause and then resume the dimming piston?


#6

A bit late reply …

but isn’t pause well… pauses the piston? then it will require to resume it. which adds quite a complication, especially when its not needed. all i need is to abort the execution of the piston, which is a lot easier then to determine if it is paused or not.

The lamp does have a specific fade function, but by the way it works using webcore, its webcore is emulating the fade, sending lower brightness commands every few seconds.


#7

I know you’ll hate my workaround BUT

if you pause the piston controlling fade out, fadeout stops… and then you can resume the piston.


#8

i added the pause piston into the motion sensed piston.
it pauses the turn off piston, so i have to resume it, otherwise the lights will never turn off.

i wonder if it will resume to light fadeout as well…
will test.

still, an interrupt piston will be much easier in this scenario.

am i the only one controlling my lights with motion sensors through webcore?


#9

Nope… but you might be the only one with them fading to off after motion ends (I assume that’s what you are doing?)


#10

Could something like this work?

I’m guessing this would start the other piston and stop the current one?


#11

4 months ago, cancel all pending tasks wouldn’t stop the fadeout.
Not sure how it is lately? if something was added in the upgrades.


#12

Hi, I have the same issue. When the electric curtains goes down I want to fade the night lamp for 30 min. However sometimes when I switch the night lamp off earlier it turns on again due fade. I have also tried cancel all pending tasks and tried a while loop that will be canceled when the light turns off but it doesn’t help. Did any of you find a solution to this or have any ideas?


#13

still being annoyed by my lights turning off on me.
pausing the piston doesn’t solve the problem. i actually think it doesnt pause, as the fade line
translates into several pulses of lower light level commands (say 80,60,40,20,0) as indicated by the log.
it doesn’t seem to stop those even when stopping the piston.

Even if it did, there would still be a problem when resuming the piston, as i guess it will first finish the execution of that piston - turn off the light, only then start it again and check if its suppose to turn it off.

There is a stop all pending tasks, but then might interrupt unrelated pistons as well.
thought it will be fixed by 2021…


#14

I have fading lights stopped by flipping a virtual switch that drives the action. For example, the attached code will stop the fading lights if I turn off the virtual switch 68.

stopLightsFading