Need some help with a programming issue.
I have a hallway light wich go's On at sunset en Off at 02.00. It's a colored light and it is dimmed to 15%.
What I want if a person is at the frontdoor the hallway light must light up to 70% for 2 minutes.
It is done by a infrared motion sensor. I've tried with the knowledge I have to program this but I don't get it working.
So some help would be appreciated.
Code: Select all
return {
on = {
timer =
{
'between 10 minutes before sunset and 23:30',
'between 23:30 and 02:00',
'at 02:00',
},
devices =
{
'color',
'sensor'
},
},
logging =
{
level = domoticz.LOG_ERROR, -- set to domoticz.LOG_INFO when all ok
marker = 'Lamp gang',
},
execute = function(dz, item )
local master = dz.devices('Kamer- masterswitch') -- virtual switch to trigger a Scene that will switch all lights off
if master.active then
dz.log('Rest of script will be ignored because master switch is activated and every light should stay off',dz.LOG_INFO )
return
end
local color = dz.devices('Gang- Kleurinstelling gang')
local sensor = dz.devices('Beweging sensor gang')
if dz.time.matchesRule('between 10 minutes before sunset and 23:30') then
color.setColor(253,244,220,15,0,0,4,0)
elseif dz.time.matchesRule('between 23:30 and 02:00') then
color.setColor(0,255,0, 10, 0, 0, 4, 0)
elseif dz.time.matchesRule('at 02:00') then
color.switchOff().checkFirst()
end
end
}