--[[
%% autostart
%% properties
%% globals
METEO
--]]
local sourceTrigger = fibaro:getSourceTrigger();
if (sourceTrigger["type"] == "autostart") then
while true do
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()+480*60) == fibaro:getValue(1, "sunsetHour")) )
and
( fibaro:getGlobalValue("METEO") == "DECOUVERT" ) -- état météo
)
then
fibaro:call(25, "setValue", "40"); -- ouverture volet arrière cuisine 40 pourcent
fibaro:call(20, "setValue", "50"); -- ouverture volet salon 50 pourcent
fibaro:call(22, "sendDefinedPushNotification", "5"); -- notification fermeture volets partiel début aprés midi
fibaro:sleep(20000); -- temps avant reouverture des volets ID 25 ET 20
fibaro:call(25, "open");
fibaro:call(25, "setValue2", "99"); -- ouverture totale volet arriere cuisine
fibaro:call(20, "open");
fibaro:call(20, "setValue2", "99"); -- ouverture totale volets salon
fibaro:call(22, "sendDefinedPushNotification", "6"); -- notification ouverture volets total fin de journée
end
fibaro:sleep(60*1000);
end
else
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
( fibaro:getGlobalValue("METEO") == "DECOUVERT" )
or
startSource["type"] == "other"
)
then
fibaro:call(25, "setValue", "40");
fibaro:call(20, "setValue", "50");
fibaro:call(22, "sendDefinedPushNotification", "5");
fibaro:sleep(30000);
fibaro:call(25, "open");
fibaro:call(25, "setValue2", "99");
fibaro:call(20, "open");
fibaro:call(20, "setValue2", "99");
fibaro:call(22, "sendDefinedPushNotification", "6");
end
end
Salut Jossalf
une petite question pourquoi la scène se relance ligne 36