Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1
- --[[
- 2
- %% autostart
- 3
- %% properties
- 4
- %% weather
- 5
- %% events
- 6
- %% globals
- 7
- --]]
- 8
- 9
- local sourceTrigger = fibaro:getSourceTrigger();
- 10
- function tempFunc()
- 11
- local currentDate = os.date("*t");
- 12
- local startSource = fibaro:getSourceTrigger();
- 13
- if (
- 14
- ( ((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) == fibaro:getValue(1, "sunsetHour")) )
- 15
- )
- 16
- then
- 17
- fibaro:call(43, "close");
- 18
- fibaro:call(98, "close");
- 19
- fibaro:call(162, "close");
- 20
- fibaro:call(55, "close");
- 21
- fibaro:call(108, "close");
- 22
- fibaro:call(117, "close");
- 23
- fibaro:call(114, "close");
- 24
- fibaro:call(111, "close");
- 25
- end
- 26
- 27
- setTimeout(tempFunc, 60*1000)
- 28
- end
- 29
- if (sourceTrigger["type"] == "autostart") then
- 30
- tempFunc()
- 31
- else
- 32
- 33
- local currentDate = os.date("*t");
- 34
- local startSource = fibaro:getSourceTrigger();
- 35
- if (
- 36
- startSource["type"] == "other"
- 37
- )
- 38
- then
- 39
- fibaro:call(43, "close");
- 40
- fibaro:call(98, "close");
- 41
- fibaro:call(162, "close");
- 42
- fibaro:call(55, "close");
- 43
- fibaro:call(108, "close");
- 44
- fibaro:call(117, "close");
- 45
- fibaro:call(114, "close");
- 46
- fibaro:call(111, "close");
- 47
- end
- 48
- 49
- end
- 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement