Ich habe mir ein Wake-Up Licht gebaut. Läuft im Schlafzimmer über insgesamt 15min vor dem Wecker.
--[[
%% autostart
%% properties
%% weather
%% events
%% globals
--]]
local sourceTrigger = fibaro:getSourceTrigger();
function tempFunc()
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
( ((currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "05:00") )
)
then
fibaro:call(158, "setValue", "100");
fibaro:call(159, "setSlider", "1", "99");
fibaro:call(159, "setSlider", "2", "0");
fibaro:call(159, "setSlider", "3", "0");
fibaro:call(159, "setSlider", "4", "0");
setTimeout(function()
fibaro:call(159, "setSlider", "2", "10");
end, 60000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "20");
end, 120000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "30");
end, 180000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "40");
end, 240000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "50");
end, 300000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "10");
fibaro:call(159, "setSlider", "2", "75");
end, 360000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "99");
end, 500000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "25");
end, 600000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "50");
end, 700000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "75");
end, 800000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "99");
end, 900000)
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(158, "setValue", "100");
fibaro:call(159, "setSlider", "1", "99");
fibaro:call(159, "setSlider", "2", "0");
fibaro:call(159, "setSlider", "3", "0");
fibaro:call(159, "setSlider", "4", "0");
setTimeout(function()
fibaro:call(159, "setSlider", "2", "10");
end, 60000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "20");
end, 120000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "30");
end, 180000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "40");
end, 240000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "50");
end, 300000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "10");
fibaro:call(159, "setSlider", "2", "75");
end, 360000)
setTimeout(function()
fibaro:call(159, "setSlider", "2", "99");
end, 500000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "25");
end, 600000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "50");
end, 700000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "75");
end, 800000)
setTimeout(function()
fibaro:call(159, "setSlider", "4", "99");
end, 900000)
end
end
Es fängt bei rot an und wird dann immer “gelber” geht dann später ins weiß über und dann klingelt auch schon der Wecker. Ich schau mir mal morgen an ob das was ist…