replace active = true for dummy switch state
Posted: Tuesday 01 August 2017 10:30
Today I tried to replace or add the 'active = true' with some logic and a dummy switch. A master switch which that enables or disables all scripts. But I could not get it working. Is this possible?
I tried many things but the latest was: "(tostring(domoticz.devices('Masterswitch').levelName == 'Automatisch'))"
Error: dzVents: Error: ...e/pi/domoticz/scripts/dzVents/generated_scripts/Test.lua:5: attempt to call field 'devices' (a nil value)
The master switch is a selector switch with the names Automatisch (= automatic) and Handmatig (= manual). Don't know why it isn't working. When I test the string with logging, I got 'true'. So I thought this would work.
Is it also possible to have some logic in it? like active = (switch 1 == 'On' and switch 2 == 'On')?
I tried many things but the latest was: "(tostring(domoticz.devices('Masterswitch').levelName == 'Automatisch'))"
Error: dzVents: Error: ...e/pi/domoticz/scripts/dzVents/generated_scripts/Test.lua:5: attempt to call field 'devices' (a nil value)
The master switch is a selector switch with the names Automatisch (= automatic) and Handmatig (= manual). Don't know why it isn't working. When I test the string with logging, I got 'true'. So I thought this would work.
Is it also possible to have some logic in it? like active = (switch 1 == 'On' and switch 2 == 'On')?