Aller au contenu
Rem's

Problème De Débug

Recommended Posts

Bonjour àtous,

Je viens de me faire ce bout de scène pour essayer de regrouper la semaine et le Week end. Cela semble fonctionné.

En revanche je n'ai plus de débug, donc difficile de faire des modifs sans bétises.

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

local sourceTrigger = fibaro:getSourceTrigger();
if (sourceTrigger["type"] == "autostart") then
while true do
    
     if fibaro:countScenes() > 1 then -- si la scène est lancée plus d'une fois alors
fibaro:abort() -- arrêt de cette lecture du script
end -- fin de la condition

-- Scene Semaine    
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) == "19:45") )
)
then
    fibaro:debug("Début de script")
    fibaro:call(101, "pressButton", "26") -- Annonce Petula
    fibaro:call(71, "turnOn")
    fibaro:call(309, "turnOn")
      fibaro:sleep(15*60*1000); -- 20h00
      
    fibaro:call(318, "pressButton", "5") -- Volet chambre descente
    fibaro:call(26, "startProgram", "2");
    fibaro:call(315, "turnOn")
    fibaro:call(70, "turnOn")
      fibaro:sleep(30*60*1000); -- 20h30

    fibaro:call(13, "turnOn")
    fibaro:call(90, "turnOn")
      fibaro:sleep(50*60*1000); -- 21h20
    fibaro:call(319, "pressButton", "9") -- Volet salon descente
      fibaro:call(13, "turnOff")
    
      fibaro:debug("Test scène semaine")
end
-- Scene Week end
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
 ( ((currentDate.wday == 1 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "19:35") )
)
then
    fibaro:debug("Début de script")
    fibaro:call(101, "pressButton", "26") -- Annonce Petula
    fibaro:call(71, "turnOn")
    fibaro:call(309, "turnOn")
      fibaro:sleep(15*60*1000); -- 20h00
      
    fibaro:call(318, "pressButton", "5") -- Volet chambre descente
    fibaro:call(26, "startProgram", "2");
    fibaro:call(315, "turnOn")
    fibaro:call(70, "turnOn")
      fibaro:sleep(30*60*1000); -- 20h30

    fibaro:call(13, "turnOn")
    fibaro:call(90, "turnOn")
      fibaro:sleep(50*60*1000); -- 21h20
    fibaro:call(319, "pressButton", "9") -- Volet salon descente
      fibaro:call(13, "turnOff")
    
      fibaro:debug("Test scène semaine")
end
      fibaro:debug("fin de scène")
  end
  fibaro:sleep(60*1000);
  end

Une idée ... Merci du coup de main

Partager ce message


Lien à poster
Partager sur d’autres sites

t'as plus de debug ? :( :(

Partager ce message


Lien à poster
Partager sur d’autres sites

×