Civilnighttime not working

Easy to use, 100% Lua-based event scripting framework.
Post Reply
BOverdevest
Posts: 5
Joined: Wednesday 28 March 2018 20:56
Target OS: Raspberry Pi
Domoticz version:
Contact:

Civilnighttime not working

Post by BOverdevest » Monday 22 October 2018 23:36

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
}
Last edited by BOverdevest on Tuesday 23 October 2018 22:53, edited 1 time in total.

User avatar
waaren
Posts: 1236
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Civilnighttime not working

Post by waaren » Tuesday 23 October 2018 0:27

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)
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

BOverdevest
Posts: 5
Joined: Wednesday 28 March 2018 20:56
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Civilnighttime not working

Post by BOverdevest » Tuesday 23 October 2018 18:13

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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests