Since the domoticz.time.matchesRule is not working correct (they work on it) i got a workaround from Waanen.
But still its not working correct:
X-Mas period will start on 20/12 till 31/12 and i give every day (thats the workaround instead of 20/12-31/12)
But now it already give me the Green color...
What do i wrong?
Code: Select all
local Version = '24.10.18'
return {
active = true,
on = {
devices = {SwitchDressoir},
},
-- logging = {marker = 'SWITCHES Control ' ..Version..'......'},
execute = function(domoticz, device)
-- HALLOWEEN
if (domoticz.devices(SwitchDressoir).active and domoticz.time.matchesRule 'on 23/10,24/10,25/10,26/10,27/10,28/10,29/10,30/10,31/10,1/11,2/11,3/11,4/11') then
domoticz.helpers.RGB(domoticz,BulbDressoirAll,100,'Blue',nil)
domoticz.helpers.RGB(domoticz,BulbDressoir2,100,'Purple',nil)
-- X-MAS
elseif (domoticz.devices(SwitchDressoir).active and domoticz.time.matchesRule 'on 20/12,21/12,22/12,23/12,24/12,25/12,26/12,27/12,28/12,29/12,30/12,31/12') then
domoticz.helpers.RGB(domoticz,BulbDressoirAll,100,'Green',nil)
-- REST VAN JAAR
elseif (domoticz.devices(SwitchDressoir).active ) then
domoticz.helpers.Kelvin(domoticz,BulbDressoirAll,nil,4000,nil)
else
domoticz.helpers.TurnOff(domoticz,BulbDressoirAll,nil,nil)
end
--domoticz.log('------------------------==<[ SWITCH '..device.idx..' On/Off ]>==--------------------', domoticz.LOG_FORCE)
end
}