Rechercher dans la communauté
Affichage des résultats pour les étiquettes 'Extinction'.
2 résultats trouvés
-
Bonsoir à tous, Je m'essaye à faite un script : Je voudrai que les lampes 50 et 70 (2 wall plug), s'éteignent 45 mm après allumage, dans la tranche horaire de 20h00 à 23h45. --[[ %% properties 50 value 70 value %% events %% globals --]] local lapin = 50 local loupion = 70 local startSource = fibaro:getSourceTrigger(); local heure = string.format(os.date("%H"), "%2d")..string.format(os.date("%M"), "%2d") local heureValable = heure >= "2000" or heure < "2345" local timmer = (tonumber(fibaro:getValue(lapin, "value")) > 0) local timmer2 = (tonumber(fibaro:getValue(loupion, "value")) > 0) if timmer and heureValable then fibaro:debug("Compte à rebours Lapin") fibaro:sleep(45*60*1000) fibaro:call(lapin, "turnOff"); fibaro:debug("Extinction Lapin") elseif timmer2 and heureValable then fibaro:debug("Compte à rebours Loupion") fibaro:sleep(45*60*1000) fibaro:call(loupion, "turnOff"); fibaro:debug("Extinction Loupion") end fibaro:sleep(60*1000); Ca ne marche pas, je n'ai rien dans la fenêtre du Débug .... Une idée. Merci de votre aide.
- 1 réponse
-
- Extinction
- lampe
-
(et %d en plus)
Étiqueté avec :
-
Voici un script de rafal.m repris sur le forum officiel. Ce script permet de basé l'éclairage automatique d'une salle de bain, toilette ... Sur l'ouverture d'une porte pour un fgk-101. Je n'ai pas retesté ce script depuis les modifications de l'alarme, je l'ai modifier pour utiliser une variable globale. -- NOTICE TO CHANGE DEVICES ID's: --[[ %% properties 7 value 17 value %% globals --]] -- BATHROOM SCENE FUNCTIONALITY: -- No extra Global variables needed! -- Automatic light depending of opening and closing door -- Time to enter - detecting another situations, like cleaning bathroom -- NOTICE TO CHANGE DEVICES ID's: doorID = 7; lightID = 17; -- time to enter, longer time will detect as another situation, like: cleaning timeToEnter = 10; local light = fibaro:getValue(lightID, 'value'); local door = fibaro:getValue(doorID, 'value'); local armed, lastArmed = fibaro:get(doorID, 'armed'); local trigger = fibaro:getSourceTrigger(); if (fibaro:countScenes()>1) then fibaro:debug('Kill second scene!'); fibaro:abort(); end if (trigger['type']=='property') then -- door trigger if (trigger['deviceID']==tostring(doorID)) then -- door opened if (door=='1') then fibaro:debug('Door opened.'); if (armed=='0') then fibaro:call(lightID, 'turnOn'); fibaro:call(doorID, 'setArmed', '1'); fibaro:call(doorID, 'setArmed', '0'); fibaro:debug('Light on!'); end -- door closed elseif (door=='0') then fibaro:debug('Door closed.'); if (armed=='1' or (os.time()-lastArmed)>=timeToEnter) then fibaro:call(lightID, 'turnOff'); fibaro:call(doorID, 'setArmed', '0'); fibaro:debug('Light off, room empty!'); else fibaro:call(doorID, 'setArmed', '1'); fibaro:debug('Someone inside!'); end end -- light manual elseif (trigger['deviceID']==tostring(lightID) and (os.time()-lastArmed)>0) then -- light manual off if (light=='0') then if (door=='1') then -- when door are opened fibaro:call(doorID, 'setArmed', '1'); else -- when door are closed fibaro:call(doorID, 'setArmed', '0'); end fibaro:debug('Light manual off!'); -- light manual on elseif (light=='1') then fibaro:call(doorID, 'setArmed', '1'); fibaro:debug('Light manual on, arming...'); end end end
- 2 réponses
-
- 1
-
- Extinction
- Script Lua
-
(et %d en plus)
Étiqueté avec :