--[[
%% autostart
%% properties
%% globals
--]]
if (fibaro:countScenes() > 1)
then fibaro:abort()
end
local sourceTrigger = fibaro:getSourceTrigger();
function tempFunc()
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if string.format("%02d:%02d", currentDate.hour, currentDate.min) == "00:00"
then
if --Urlaub anwesend
(string.format("%04d-%02d-%02d", currentDate.year, currentDate.month, currentDate.day) == "2015-xx-xx"
--or ...
or string.format("%04d-%02d-%02d", currentDate.year, currentDate.month, currentDate.day) == "2015-xx-xx")
then
if fibaro:getGlobalValue("Urlaub") ~= "anwesend"
then fibaro:setGlobal("Urlaub", "anwesend");
end
elseif --Urlaub abwesend
(string.format("%04d-%02d-%02d", currentDate.year, currentDate.month, currentDate.day) >= "2015-xx-xx" --von
and string.format("%04d-%02d-%02d", currentDate.year, currentDate.month, currentDate.day) <= "2015-xx-xx") --bis
then
if fibaro:getGlobalValue("Urlaub") ~= "abwesend"
then fibaro:setGlobal("Urlaub", "abwesend");
end
else --kein Urlaub
if fibaro:getGlobalValue("Urlaub") ~= "nein"
then fibaro:setGlobal("Urlaub", "nein");
end
end
end
setTimeout(tempFunc, 60*1000)
end
tempFunc()
Verwendbar um z.B. Heizung, Rollos oder Weckradio urlaubsabhängig zu steuern.