I would like to know if it is possible to switch the timer script on a dummy via Dzvents.
By this I mean that I have a dummy that shows the seasons. Autumn, Winter, etc ..
Now my script switches to a time window between 6:50 AM and 8:00 PM, but it always does. But I can also choose that for example
Dummy = Autumn, then switch between 7am & 9pm
Dummy = Winter, then switch between 08:00 & 20:00
Or is this not possible?
This is the script I currently use for switching the lamps.
Code: Select all
return
{
on =
{
timer =
{
"every 3 minutes on mon, tue, wed, thu, fri, sat, sun between 06:50 and 20:00",
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Auto verlichting ON',
},
execute = function(dz)
local lowerLux = 11 -- Onder welke niveau moet het script starten.
local upperLux = 45 -- Boven de waarde gaan de lampen automatisch uit.
local currentLux = dz.devices(46).lux --lux sensor
local woonkamerlampen = dz.groups("Woonkamer") --Groep schakelaar Woonkamer.
local tuin = dz.groups("Tuin") --Groep schakelaar Tuin.
local phoneLarsOn = dz.devices(150).state == 'On' --Dummy Telefoon Lars
local phoneDesireeOn = dz.devices(151).state == 'On' --Dummy Telefoon Dees
if ( currentLux < lowerLux ) and ( phoneLarsOn or phoneDesireeOn ) then
woonkamerlampen.switchOn().checkFirst()
tuin.switchOn().checkFirst()
elseif currentLux > upperLux then
woonkamerlampen.switchOff().checkFirst()
tuin.switchOff().checkFirst()
end
end
}
Because I had seen something where I suspect that it is possible.
Code: Select all
return
{
on =
{
timer =
{
'at sunset',
'at ' .. Sleep,
},
customEvents =
{
retrigger,
}
},