Timer switchOn/Off with after/forXXX in dzvents 2.4.3

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

Moderator: leecollings

Post Reply
MiWa4711
Posts: 7
Joined: Tuesday 28 November 2017 18:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Timer switchOn/Off with after/forXXX in dzvents 2.4.3

Post by MiWa4711 »

Hi,

got Pi3 with
Version: 3.9177
Build Hash: 8833e747
Compile Date: 2018-04-03 22:05:17
dzVents Version: 2.4.3

in //www.domoticz.com/wiki/DzVents:_next_gen ... _scripting there is a description how to ..... but it does not really work. Please advice....

Thanks.
Michael

That's just how it works and you will have to deal with it in your script. So, instead of simply re-issuing switchOn().forMin(5) you have to check the switch's state first:

if (light.active) then
light.switchOff().afterMin(5)
else
light.switchOn().forMin(5)
end
or issue these two commands both as they are mutually exclusive:

light.switchOff().checkFirst().afterMin(5)
light.switchOn().checkFirst().forMin(5)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Timer switchOn/Off with after/forXXX in dzvents 2.4.3

Post by dannybloe »

So what is your setup? What switches do you have, how are they called and what is the exact script that you created?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest