Page 1 of 1

How stop delayed swtich in scene

Posted: Tuesday 31 March 2020 22:17
by ramirez22
Hello,

I have an irrigation system with some areas and a pump.

I programed a scene to launch manually the irrigation. I used the on and off delay to chain the areas (in seconds for tests):
Switch 1 (area 1) _ ON delay:0 _ OFF delay:6
Switch 2 (area 2) _ ON dealy:5 _ OFF delay:6
Switch 3 (area 3) _ ON delay:10 _ OFF delay:6
Switch 4 (pump) _ ON delay:1 _ OFF delay:15
The permutation between 2 areas are not at the same moment to be sure that no overpressure in circuit occurs and the pump start after opening the first valve and stop befor close the last one (for the same reason).

All works perfectly. But in case of I need to stop the process, I made another scene with all switch to OFF with 1 sec delay off for the valves (always to prevent overpressure).

When I activate the "Stop scene", all output goes to off. But if cycle is not finnished, the switchs continue to be activated. If I stop for example at 7 seconds, switch 2 and pump goes OFF. But at 10 seconds, the switch 3 goes ON etc...

Is it possible to have acces to the timer of the scene (throw a scrypt for example) to reset them ?
Or do you have any other solution ?

Thanks for your help.
Regards.

Re: How stop delayed swtich in scene

Posted: Tuesday 31 March 2020 22:23
by waaren
ramirez22 wrote: Tuesday 31 March 2020 22:17 Is it possible to have acces to the timer of the scene (throw a scrypt for example) to reset them ?
No
Or do you have any other solution ?
Put all logic now in the scene timers in a dzVents script.
The combination of the methods. afterSec() and cancelQueuedCommands() will do what you describe

Re: How stop delayed swtich in scene

Posted: Wednesday 01 April 2020 7:06
by ramirez22
Hello !
Thanks for answer.
So after learn Python for my plugin, I have to learn Lua for my process :lol:
I will try that, thanks again.
Regard