checkfirst and selectorswitches  [Solved]

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

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

checkfirst and selectorswitches

Post by pvklink »

Hi,

I have a selector switch that contains all sort of alarms (fire/smoke, panic, door, pir etc.)
When you select one, a aalrmtype is executed.
These alarmtypes can also be activated by sensors.

My latest sensor are PIR's, so i made an alarmtype Pir. Pir's go off x-times so i added .checkFirst() to the selector switch, and getting an error...

dz.devices('Alarm').switchSelector('Pir').checkFirst()

Isnt this supported?
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: checkfirst and selectorswitches

Post by waaren »

pvklink wrote: Friday 24 January 2020 18:20 dz.devices('Alarm').switchSelector('Pir').checkFirst()
Isnt this supported?
Not yet but I am testing a modification to the code that will allow this. Should not take too long..
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: checkfirst and selectorswitches

Post by snellejellep »

ah that's why that is causing errors for me... not yet supported. waiting for this feature!
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: checkfirst and selectorswitches

Post by pvklink »

great..
i see two scenarios....
1. check on switch on or off
2. more complex: check on switch on with the same option...

i am happy with every action...
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: checkfirst and selectorswitches

Post by waaren »

pvklink wrote: Friday 24 January 2020 21:44 I see two scenarios....
1. check on switch on or off
2. more complex: check on switch on with the same option...
Implemented in dzVents 2.5.7 (domoticz V4.11649). You should now be able to do something like

Code: Select all

dz.devices('selectorName').switchSelector('levelName').afterSec(10).checkFirst().silent()
domoticz.devices(345).switchSelector(30).checkFirst()
or the likes...
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: checkfirst and selectorswitches  [Solved]

Post by waaren »

waaren wrote: Saturday 25 January 2020 1:05
pvklink wrote: Friday 24 January 2020 21:44 I see two scenarios....
1. check on switch on or off
2. more complex: check on switch on with the same option...
Implemented in dzVents 2.5.7 (domoticz V4.11650). You should now be able to do something like

Code: Select all

dz.devices('selectorName').switchSelector('levelName').afterSec(10).checkFirst().silent()
domoticz.devices(345).switchSelector(30).checkFirst()
or the likes...
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: checkfirst and selectorswitches

Post by pvklink »

Great!
will try it imm.
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: checkfirst and selectorswitches

Post by pvklink »

And it works!
Thanks @waaren
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest