Aller au contenu

Code Lua Avec Plage Horaire


Rem's

Messages recommandés

Bonsoir a tous,

 

J'essaye de faire fonctionner cette scène, mais je dois avoir une erreur quelque part ... :(

 

Help Please ...  :rolleyes:

--[[
%% properties

%% globals
--]]

local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
 ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "22:49") )
)
then
	fibaro:call(131, "turnOn");
	fibaro:call(43, "turnOn");
    fibaro:call(2, "sendDefinedSMSNotification", "3366162XXXX", "10");
      fibaro:debug("Allumage lumières")
end
if (
 ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "22:50") )
)
then
	fibaro:call(131, "turnOff");
	fibaro:call(43, "turnOff");
    fibaro:call(2, "sendDefinedSMSNotification", "33661620092", "9");
      fibaro:debug("Extinction limières")
end
fibaro:sleep(60*1000);
Lien vers le commentaire
Partager sur d’autres sites



--[[
%% autostart
%% properties
%% globals
--]]


fibaro:debug("HC2 start script at " .. os.date());

if (fibaro:countScenes() > 1) then
fibaro:debug("Script already running.");
fibaro:abort();
end

while true do

-- START CODE
.
.
.
.
-- END CODE

fibaro:sleep(60 * 1000);
end

Lien vers le commentaire
Partager sur d’autres sites

×
×
  • Créer...