Code: Select all
%% autostart
%% properties
326 value
%% weather
%% events
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
if (
((tonumber(fibaro:getValue(326, "value")) > 0 ) and (tonumber(fibaro:getValue(166, "value")) == 0 ) and (os.date("%H:%M") >= "22:30") and (os.date("%H:%M") <= "23:59") )
or
((tonumber(fibaro:getValue(326, "value")) > 0 ) and (tonumber(fibaro:getValue(166, "value")) == 0 ) and (os.date("%H:%M") >= "00:00") and (os.date("%H:%M") <= "05:15") )
)
then
fibaro:call(166, "turnOn");
setTimeout(function()
fibaro:call(166, "turnOff");
end, 10*1000)
end