Page 1 of 1
Other time-off in daylight saving time period
Posted: Thursday 03 December 2020 23:25
by maceddy
I don't really know where to post but since all my 'scripts' are blockly based I start here.
My garden lighting goes on at sunset and switches off at 23:45. However, I would like to have it turned off one hour earlier in the winter (no DST).
I was looking to make a 'DST' switch with on/off but I can not really find a way of doing that.
Maybe I am better off with Lua or dZvents but I have zero experience in that. Who can help me on the way with this?
Re: Other time-off in daylight saving time period
Posted: Friday 04 December 2020 0:48
by waaren
maceddy wrote: ↑Thursday 03 December 2020 23:25
Maybe I am better off with Lua or dZvents but I have zero experience in that. Who can help me on the way with this?
In dzVents you can set a switch named dstSwitch using below script.
__________________________________________________________________________________________________________________________
When not yet familiar with dzVents please start with reading
Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents enabled' is checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
___________________________________________________________________________________________________________________________
Code: Select all
return
{
on =
{
timer =
{
'at 00:03',
},
},
execute = function(dz)
local t = os.date('*t')
if t.isdst then
dz.devices('dstSwitch').switchOn().checkFirst()
else
dz.devices('dstSwitch').switchOff().checkFirst()
end
end
}