Hallo, ich möchte das 3 Hue Lampen bei Sonnenuntergang eingeschalten und nach 3 Stunden ausgeschalten werden. Ist das so korrekt:
--[[
%% 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) == fibaro:getValue(1, "sunsetHour")) )
)
then
fibaro:call(593, "turnOn")
fibaro:call(593, "changeSaturation", 255)
fibaro:call(593, "changeBrightness", 255)
fibaro:call(593, "changeHue", 40860);
fibaro:call(594, "turnOn")
fibaro:call(594, "changeSaturation", 255)
fibaro:call(594, "changeBrightness", 255)
fibaro:call(594, "changeHue", 40860);
fibaro:call(595, "turnOn")
fibaro:call(595, "changeSaturation", 255)
fibaro:call(595, "changeBrightness", 255)
fibaro:call(595, "changeHue", 40860);
fibaro:call(527, "pressButton", "23");
setTimeout(function()
fibaro:call(593, "turnOff");
fibaro:call(594, "turnOff");
fibaro:call(595, "turnOff");
end, 10800000)
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:call(593, "turnOn")
fibaro:call(593, "changeSaturation", 255)
fibaro:call(593, "changeBrightness", 255)
fibaro:call(593, "changeHue", 40860);
fibaro:call(594, "turnOn")
fibaro:call(594, "changeSaturation", 255)
fibaro:call(594, "changeBrightness", 255)
fibaro:call(594, "changeHue", 40860);
fibaro:call(595, "turnOn")
fibaro:call(595, "changeSaturation", 255)
fibaro:call(595, "changeBrightness", 255)
fibaro:call(595, "changeHue", 40860);
fibaro:call(527, "pressButton", "23");
setTimeout(function()
fibaro:call(593, "turnOff");
fibaro:call(594, "turnOff");
fibaro:call(595, "turnOff");
end, 10800000)
end
end