Page 1 of 1

Civilnighttime not working

Posted: Monday 22 October 2018 23:36
by BOverdevest
I would like to turn on lights for some time when I come home in the evening and it is dark.
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
}

Re: Civilnighttime not working

Posted: Tuesday 23 October 2018 0:27
by waaren
BOverdevest wrote: Monday 22 October 2018 23:36 ...
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?
What version are you on ? (civilnighttime is only part of dzVents from version 2.4.7 onwards)

Re: Civilnighttime not working

Posted: Tuesday 23 October 2018 18:13
by BOverdevest
Hi
What version are you on ? (civilnighttime is only part of dzVents from version 2.4.7 onwards)
Yes, I saw this in the documentation as well; I'm on dzVents Version: 2.4.7, so it should be working.

greetz