Civilnighttime not working

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

Moderator: leecollings

Post Reply
BOverdevest
Posts: 23
Joined: Wednesday 28 March 2018 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11307
Location: Nederland
Contact:

Civilnighttime not working

Post 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
}
Last edited by BOverdevest on Tuesday 23 October 2018 22:53, edited 1 time in total.
HUE, Tradfri, Zwave, RFXCOM, rooted TOON, PS4
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Civilnighttime not working

Post 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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
BOverdevest
Posts: 23
Joined: Wednesday 28 March 2018 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11307
Location: Nederland
Contact:

Re: Civilnighttime not working

Post 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
HUE, Tradfri, Zwave, RFXCOM, rooted TOON, PS4
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest