Page 1 of 1

cancelQueuedCommands

Posted: Thursday 19 April 2018 21:48
by dlefol
Hello,

I have a scene which starts 3 lights, each within one minute of the previous one (first light then 1 min later 2nd light then 1 min later 3rd light). Can I use the cancelQueuedCommands in a script to stop the scene in the middle and avoid the lights to switch on 1 minute later ?

I've tried to use it but no luck. Does it work only for commands which have been sent using dzVents functions such as afterMin(xx) ? And if it s not possible that way can I do it another way ?

Thanks

PS: I really like dzVents and am still discovering loads of new functions that are usefull. Thanks a lot for the good work!

Re: cancelQueuedCommands

Posted: Saturday 21 April 2018 9:39
by waaren
Hi diefol,
would it be an option for you to replace part of the scene functionality with a dzVents script, using the trigger

on = { scenes = { 'myScene' } }

?

something like: if the scene is activated then the script takes over and activates the remaining devices with .switchOn().afterMin(xx)
by doing it in that way the cancelQueuedCommands() method becomes available to you

Re: cancelQueuedCommands

Posted: Monday 23 April 2018 7:26
by dannybloe
I think you cannot cancel the scene (not sure about that though) but you should be able to cancel the queues for each device in the scene individually. You can loop over the devices in the scene like this:

Code: Select all

myScene.devices().forEach(function(device) device.cancelQueuedCommands() end)