I installed a PIR outside and use it as a trigger. Of course I could use the light sensor in the sensor, but I rather take control in the dzVents script.
Some lights are turned on with some delay and all will turn off after some time. if lights are already on, they will not be switched on (so they do not turn off after some time).
To restrict the script to only run when it is (expected to be) dark outside, i wanted to use the "at civilnighttime", but the script will not run. If i use "at nighttime", it will work as intended.
Any clues, hints, obvious mistakes? How to make civilnighttime work?
Code: Select all
return {
on = {
devices = {['Voortuin PIR Sensor'] = {'at civilnighttime'}}
-- devices = {['Voortuin PIR Sensor'] = {'at nighttime' }}
},
execute = function(domoticz, device)
domoticz.devices('Buiten Verlichting').switchOn().checkFirst().forMin(10)
domoticz.devices('Achterdeur Verlichting').switchOn().checkFirst().forMin(10).afterSec(10)
domoticz.devices('BG Verlichting').switchOn().checkFirst().forMin(10).afterSec(15)
domoticz.devices('Woonkamer Tonone').switchOn().checkFirst().forMin(10)
end
}