--[[ %% autostart %% properties %% 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) == "08:12") and tonumber(fibaro:getGlobalValue("Klappe_Open")) == tonumber("1") ) ) then fibaro:call(46, "turnOn"); fibaro:call(14, "sendDefinedPushNotification", "6"); fibaro:setGlobal("Klappe_Open", "0"); end setTimeout(tempFunc, 60*1000) end if (sourceTrigger["type"] == "autostart") then tempFunc() else 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 tonumber(fibaro:getGlobalValue("Klappe_Open")) == tonumber("1") ) or startSource["type"] == "other" ) then fibaro:call(46, "turnOn"); fibaro:call(14, "sendDefinedPushNotification", "6"); fibaro:setGlobal("Klappe_Open", "0"); end end