Hallo,
ich habe folgendes:
--[[
%% 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 os.date("%H:%M", os.time()-15*60) == fibaro:getValue(1, "sunsetHour")) )
)
then
fibaro:call(33, "close");
fibaro:call(29, "close");
setTimeout(function()
fibaro:call(5, "close");
end, 8000)
setTimeout(function()
fibaro:call(25, "close");
end, 10000)
setTimeout(function()
fibaro:call(31, "close");
end, 12000)
setTimeout(function()
fibaro:call(35, "close");
end, 15000)
setTimeout(function()
fibaro:call(27, "close");
end, 16000)
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(33, "close");
fibaro:call(29, "close");
setTimeout(function()
fibaro:call(5, "close");
end, 8000)
setTimeout(function()
fibaro:call(25, "close");
end, 10000)
setTimeout(function()
fibaro:call(31, "close");
end, 12000)
setTimeout(function()
fibaro:call(35, "close");
end, 15000)
setTimeout(function()
fibaro:call(27, "close");
end, 16000)
end
end
Jetzt möchte ich gerne, dass wenn die Szene startet, die einzelnen IDs die Verzögerungen Zufällig in einem Bereich (z.B: 5 - 10 Sekunden) gestartet werden. Kann mir da einer einen Tipp geben wie ich das einbaue?