Aller au contenu

scenario filtration piscine


marpas01

Messages recommandés

bonjour

j ai domotisé la filtration  de ma piscine

et fait ce scenario pour filtrer pendant 3 plages dans la journée

mais ça ne fonctionne pas

pouvez-vous m'aider

merci d'avance

 

--[[
%% autostart
%% properties
%% weather
%% 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 string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "0") )
)
then
    fibaro:call(260, "turnOn");
    setTimeout(function()
        fibaro:call(260, "turnOff");
    end, 14400000)
end

setTimeout(tempFunc, 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 string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "08:00") )
)
then
    fibaro:call(260, "turnOn");
    setTimeout(function()
        fibaro:call(260, "turnOff");
    end, 14400000)
end

setTimeout(tempFunc, 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 string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "14:00") )
)
then
    fibaro:call(260, "turnOn");
    setTimeout(function()
        fibaro:call(260, "turnOff");
    end, 21600000)
end

setTimeout(tempFunc, 60*1000)

 

"end"

 

 

local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
Modifié par marpas01
Lien vers le commentaire
Partager sur d’autres sites

×
×
  • Créer...