Can i use this time option 'on 23/11-25/12' in a IF statement or only in a timer?
cheers,
Peter
I tried this:
Code: Select all
local Version = '18.07.18'
return {
active = true,
on = {
devices = {SwitchDressoir},
},
-- logging = {marker = 'SWITCHES Control ' ..Version..'......'},
execute = function(domoticz, device)
if (domoticz.devices(SwitchDressoir).active) then
if ('on 22/10-31/10') then -- HALLOWEEN
domoticz.helpers.RGB(domoticz,BulbDressoirAll,100,'Blue',nil)
domoticz.helpers.RGB(domoticz,BulbDressoir2,100,'Purple',nil)
elseif ('on 20/12-31/12') then -- XMAS
domoticz.helpers.RGB(domoticz,BulbDressoirAll,100,'Green',nil)
else -- NORMAL
domoticz.helpers.RGB(domoticz,BulbDressoirAll,100,'White',nil)
end
elseif (not domoticz.devices(SwitchDressoir).active) then
domoticz.helpers.TurnOff(domoticz,BulbDressoirAll,nil,nil)
end
--domoticz.log('------------------------==<[ SWITCH '..device.idx..' On/Off ]>==--------------------', domoticz.LOG_FORCE)
end
}