Selector switch: trying to get forMin() working  [Solved]

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

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Selector switch: trying to get forMin() working

Post by Number8 »

Hello
A button triggers a dzVents script that sets for x minutes a selector switch to level HG. Initial state of the selector switch is Off (level 0).

Code: Select all

dz.devices(383).switchSelector('HG').forMin(1)
After the button is pushed, the selector switch is set to the expected level. After one minutes domoticz logs

Code: Select all

2020-05-11 13:34:51.913 (Dummy) Light/Switch (Sèche serviette)
Sèche serviette is the selectorSwitch 383, but it does not return to the Off state. What I'm not understanding?
dzVents 3.0.4
Debian buster on NUC and three RPi with buster.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Selector switch: trying to get forMin() working  [Solved]

Post by waaren »

Number8 wrote: Monday 11 May 2020 13:41 A button triggers a dzVents script that sets for x minutes a selector switch to level HG. Initial state of the selector switch is Off (level 0).
but it does not return to the Off state.
The forMin, forSec, forHour options are not available for the switchSelector method. dzVents cannot know where to switch back to.
For this case use

Code: Select all

dz.devices(383).switchSelector('HG')
dz.devices(383).switchSelector('Off').afterSec(60)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: Selector switch: trying to get forMin() working

Post by Number8 »

Thanks
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest