Rechercher dans la communauté
Affichage des résultats pour les étiquettes 'Controle'.
1 résultat trouvé
-
Bonjour, Sur le post du script pour le contrôle du niveau des piles j'ai abordé le sujet nÅ“uds morts pour les détecter et voici un script tip top qui/ - Contrôle les nÅ“uds morts, - Chercher a les réveiller, - Envoie des notifications pour avertir --[[ %% autostart %% properties %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); if (sourceTrigger["type"] == "autostart") then while true do local currentDate = os.date("*t"); local startSource = fibaro:getSourceTrigger(); if ( ( (tonumber(os.date("%H%M")) >= tonumber(string.format("%02d%02d", "07", "00")) and tonumber(os.date("%H%M")) <= tonumber(string.format("%02d%02d", "23", "00"))) and (math.floor(os.time()/60)-math.floor(1369026000/60))%2 == 0 ) ) then local i = 1 local TotalDevices = 156 + 1 while i < TotalDevices do local status = fibaro:getValue(i, 'dead'); if status == "1" then fibaro:setGlobal('lastDeadNode', i); -- fibaro:call(30, "pressButton", "6"); fibaro:call(1, "wakeUpDeadDevice",i); fibaro:debug("Try to wake up node "..i); fibaro:call(68, "sendPush", "Try to wake up node "..i); fibaro:sleep(5*1000); local status = fibaro:getValue(i, 'dead'); if status == "1" then fibaro:debug("Device "..i.." still dead"); fibaro:call(68, "sendPush", "Device "..i.." still dead"); -- fibaro:call(30, "pressButton", "6"); -- fibaro:call(65, "sendDefinedPushNotification", "9"); -- fibaro:call(2, "sendEmail", "DEAD "..i); else -- fibaro:call(30, "pressButton", "7"); fibaro:debug("Device "..i.." fixed"); fibaro:call(68, "sendPush", "Device "..i.." fixed"); end else end i = i + 1 end end fibaro:sleep(60*1000); end else local currentDate = os.date("*t"); local startSource = fibaro:getSourceTrigger(); if ( startSource["type"] == "other" ) then fibaro:debug("send notification"); fibaro:call(68, "sendPush", "start check dead node"); local i = 1 local TotalDevices = 156 + 1 while i < TotalDevices do local status = fibaro:getValue(i, 'dead'); if status == "1" then fibaro:setGlobal('lastDeadNode', i); -- fibaro:call(30, "pressButton", "6"); fibaro:call(1, "wakeUpDeadDevice",i); fibaro:debug("Try to wake up node "..i); fibaro:call(68, "sendPush", "Try to wake up node "..i); fibaro:sleep(5*1000); local status = fibaro:getValue(i, 'dead'); if status == "1" then fibaro:debug("Device "..i.." still dead"); fibaro:call(68, "sendPush", "Device "..i.." still dead"); -- fibaro:call(30, "pressButton", "6"); -- fibaro:call(65, "sendDefinedPushNotification", "9"); -- fibaro:call(2, "sendEmail", "DEAD "..i); else -- fibaro:call(30, "pressButton", "7"); fibaro:debug("Device "..i.." fixed"); fibaro:call(68, "sendPush", "Device "..i.." fixed"); end else end i = i + 1 end end end Voici le script,son auteur est Olivier MALE. Il faut l'adapter pour le N° d'ID pour le push. Son auteur a aussi mis des "--" devant certaines lignes de notifications push et de virtual device, perso j'ai supprimé ces lignes. Le script fonctionne nickel chez moi.
- 147 réponses
-
- Script Lua
- Controle
-
(et %d en plus)
Étiqueté avec :