Hallo
i need write into one scene more variables, how make this? For example scene for change Time Of Day (Morning, Day, Evening, Night) i need write - for every day when is 05:00 am than "TimeOfDay" = "Morning", when is 08:00 am than "TimeOfDay" = "Day", when is 17:00 than "TimeOfDay" = "Evening" and last when is 22:00 than "TimeOfDay" = "Night"
yes it's easy to make 4 scenes for each command separately, but how write into one scene all 4 variables scenes?
i have first
-- Scene for Morning --
--[[
%% autostart
%% properties
%% weather
%% events
%% globals
--]]
local sourceTrigger = fibaro:getSourceTrigger();
function tempFunc()
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "05:00") )
)
then
fibaro:setGlobal("TimeOfDay", "Morning");
end
setTimeout(tempFunc, 60*1000)
end
if (sourceTrigger["type"] == "autostart") then
tempFunc()
else
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
startSource["type"] == "other"
)
then
fibaro:setGlobal("TimeOfDay", "Morning");
end
end
Thank you