Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- %% autostart
- %% properties
- %% globals
- --]]
- if fibaro:countScenes() > 1 then fibaro:abort(); fibaro:debug("aborted!"); end
- local sourceTrigger = fibaro:getSourceTrigger();
- fibaro:debug("Старт!");
- if (sourceTrigger["type"] == "autostart" or sourceTrigger["type"] == "other") then
- while true do
- local currentDate = os.date("*t");
- local startSource = fibaro:getSourceTrigger();
- local curTime=string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min);
- --туалет
- if(curTime == '00:00')
- then
- fibaro:debug("Туалет ВЫКЛ");
- fibaro:call(123, "pressButton", "8")
- end
- if(curTime == '07:00')
- then
- fibaro:debug("Туалет ВКЛ");
- fibaro:call(123, "pressButton", "9")
- end
- --ванна
- if(curTime == '00:00')
- then
- fibaro:debug("Ванна ВЫКЛ");
- fibaro:call(123, "pressButton", "2")
- end
- if(curTime == '17:00')
- then
- fibaro:debug("Ванна ВКЛ");
- fibaro:call(123, "pressButton", "3")
- end
- --кухня
- if(curTime == '20:00')
- then
- fibaro:debug("кухня ВЫКЛ");
- fibaro:call(123, "pressButton", "11")
- end
- if(curTime == '06:00')
- then
- fibaro:debug("кухня ВКЛ");
- fibaro:call(123, "pressButton", "12")
- end
- --прихожка
- if(curTime == '06:00')
- then
- fibaro:debug("прихожка ВЫКЛ");
- fibaro:call(123, "pressButton", "20")
- end
- if(curTime == '00:00')
- then
- fibaro:debug("прихожка ВКЛ");
- fibaro:call(123, "pressButton", "21")
- end
- fibaro:sleep(60*1000);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement