cancelQueuedCommands

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
dlefol
Posts: 35
Joined: Monday 21 December 2015 16:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

cancelQueuedCommands

Post 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!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: cancelQueuedCommands

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: cancelQueuedCommands

Post 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)
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest