I am starting to begin programming in dzvents. As a newbie i am stumbling into beginners problems such as timing.
I have a sensor wich detect movement and a dimmable lamp. I want to use four different time frames each with a different dim level and time to switch off. I have it working in Blockly but I want all my Blockly's transferred to dzvents.
devices: sensor and dimmer
timeframes: sunrise-13:00, 13:00-sunset, sunset-23:59 and 23:59-sunrise
switchoff: 4 minutes off 4 minutes 2 minutes
dimlevel 50% 0% 50% 10%
I have a starting script but that is only for one time frame. I am having problems with programming more than one time frame.
I hope someone can give me a start in how to use time frames.
thanx
Piet
Code: Select all
return {
active = true,
on = {
devices = {
['Sensor'] = {'at 23:59-04:00'}
}
},
execute = function(domoticz, Sensor, timer)
if domoticz.devices('Sensor').state == 'On' then
domoticz.devices('Dimmer').dimTo(50).forMin(2)
end
end
}