-
Compteur de contenus
3 525 -
Inscription
-
Dernière visite
-
Jours gagnés
10
Tout ce qui a été posté par 971jmd
-
juste pour savoir, le typee:lower() correspond a quoi exactement
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
j'ai tester tout fonctionne
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
ça donne : protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id,typee,args) if (type(id) ~= "table") then id = {id} end for i=1, #id do if typee:lower() == "local_rf" then if args:lower() == "on" then fibaro:call(id[i], "setProtection", 2, 1) end end if typee:lower() == "local_rf" then if args:lower() == "off" then fibaro:call(id[i], "setProtection", 0, 0) end end if typee:lower() == "local" then if args:lower() == "on" then fibaro:call(id[i], "setProtection", 2, 0) end end if typee:lower() == "local" then if args:lower() == "off" then fibaro:call(id[i], "setProtection", 0, 2) end end if typee:lower() == "rf" then if args:lower() == "on" then fibaro:call(id[i], "setProtection", 0, 1) end end if typee:lower() == "rf" then if args:lower() == "off" then fibaro:call(id[i], "setProtection", 1, 0) end end end end },
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
effectivement ça fonctionne
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
salut quel différence entre httpRequest mais un api.post()
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
mon premier code avec la fonctionne protection couvre feu de la chambre des enfants a 21h00 ---extinction de la suspension et blocage de l'interupteur GEA.add( true, 30 "Interrupteur CH Bloqué",{ {"Time", "21:00", "21:01"}, {"turnOff", id["SUSPLMAPEENFANT"]}, {"Protection", id["SUSPLMAPEENFANT"], "local", "on"}}) ---Déblocaghe de l'interupteur GEA.add(true, 30, "Interrupteur CH Débloqué",{{"Time", "00:00", "00:01"}, {"Protection", id["SUSPLMAPEENFANT"], "local", "off"}})
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
oufffff voila tout semble bien fonctionné protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id,typee,args) if (type(id) ~= "table") then id = {id} end for i=1, #id do GEA.getMessage(GEA.incdec(value, GEA.options.property.getValue(id, property)))) end end local url = 'http://127.0.0.1:11111/api/devices/'..id[i]..'/action/setProtection' local datas if typee:lower() == "local_rf" then if args:lower() == "on" then datas = '{ "args": [2,1]}' end end if typee:lower() == "local_rf" then if args:lower() == "off" then datas = '{ "args": [0,0]}' end end if typee:lower() == "local" then if args:lower() == "on" then datas = '{ "args": [2,0]}' end end if typee:lower() == "local" then if args:lower() == "off" then datas = '{ "args": [0,2]}' end end if typee:lower() == "rf" then if args:lower() == "on" then datas = '{ "args": [0,1]}' end end if typee:lower() == "rf" then if args:lower() == "off" then datas = '{ "args": [1,0]}' end end local http = net.HTTPClient() http:request (url, { options = { method = "POST", data = datas }, success = function(response) end, error = function(err) tools.error(err) end }) end end }, -- Pour LOCAL et RF --Bloqué GEA.add(condition , 30, "Interrupteur Bloqué RF & LOCAL",{ {"Protection", 340, "local_rf", "on"}}) GEA.add(condition , 30, "Interrupteur Bloqué RF & LOCAL",{ {"Protection", {340,452}, "local_rf", "on"}}) --Débloqué GEA.add(condition , 30, "Interrupteur Débloqué RF & LOCAL",{ {"Protection", 340, "local_rf", "off"}}) GEA.add(condition , 30, "Interrupteur Débloqué RF & LOCAL",{ {"Protection", {340,452}, "local_rf", "off"}}) -- Pour LOCAL uniquement --Bloqué GEA.add(condition , 30, "Interrupteur Bloqué LOCAL",{ {"Protection", 340, "local", "on"}}) GEA.add(condition , 30, "Interrupteur Bloqué LOCAL",{ {"Protection", {340,452}, "local", "on"}}) --Débloqué GEA.add(condition , 30, "Interrupteur Débloqué LOCAL",{ {"Protection", 340, "local", "off"}}) GEA.add(condition , 30, "Interrupteur Débloqué LOCAL",{ {"Protection", {340,452}, "local", "off"}}) -- Pour RF uniquement --Bloqué GEA.add(condition , 30, "Interrupteur Bloqué RF ",{ {"Protection", 340, "rf", "on"}}) GEA.add(condition , 30, "Interrupteur Bloqué RF ",{ {"Protection", {340,452}, "rf", "on"}}) --Débloqué GEA.add(condition , 30, "Interrupteur Débloqué RF ",{ {"Protection", 340, "rf", "off"}}) GEA.add(condition , 30, "Interrupteur Débloqué RF ",{ {"Protection", {340,452}, "rf", "off"}}) merci a toi @pepite
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
enfin mai il y avait des problèmes au niveau des arguments mai le plus gros problème est sur la ligne local url = 'http://127.0.0.1:11111/api/devices/340/action/setProtection' ne prend pas en compte ID pour que ça fonctionne j'ai du placée ID manuellement ID340 protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id,typee,args) if (type(id) ~= "table") then id = {id} end for i=1, #id do action=function(id, property, value) if (type(id) ~= "table") then id = {id} end for i=1, #id do fibaro:call(id[i], "setProperty", property, GEA.getMessage(GEA.incdec(value, GEA.options.property.getValue(id, property)))) end end local url = 'http://127.0.0.1:11111/api/devices/340/action/setProtection' local datas if typee:lower() == "local_rf" then if args:lower() == "on" then datas = '{ "args": [2,1]}' end end if typee:lower() == "local_rf" then if args:lower() == "off" then datas = '{ "args": [0,0]}' end end if typee:lower() == "local" then if args:lower() == "on" then datas = '{ "args": [2,0]}' end end if typee:lower() == "local" then if args:lower() == "off" then datas = '{ "args": [0,2]}' end end if typee:lower() == "rf" then if args:lower() == "on" then datas = '{ "args": [0,1]}' end end if typee:lower() == "rf" then if args:lower() == "off" then datas = '{ "args": [1,0]}' end end local http = net.HTTPClient() http:request (url, { options = { method = "POST", data = datas }, success = function(response) end, error = function(err) tools.error(err) end }) end end },
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
bon je n'y a rive pas je pense que ça vient de la méthode post
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
Pour info reçois bien la notif : Interrupteur Bloqué RF & LOCAL GEA.add(true, 30, "Interrupteur Bloqué RF & LOCAL",{ {"Protection", 452, "local", "On"}} )
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
j'ai toujours le code erreur Erreur, vérifier : [Protection, [452,"Local","On"]]
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
désolé j'ai pas coller le bon code, j'ai rectifiée
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
@pepite salut oui effectivement je m'amuse j'ai tester plusieurs combinaison et j'ai comme erreur : [DEBUG] 07:25:48: [Démarrage] #7 [true][Protection, [452,"Local","On"]] [DEBUG] 07:25:48: Erreur, vérifier : [Protection, [452,"Local","On"]] [DEBUG] 07:26:18: ... vérification en cours #2 @60s... protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id,type,args) if (type(id) ~= "table") then id = {id} end for i=1, #id do local url = 'http://127.0.0.1:11111/api/devices/'..id..'/action/setProtection' local datas if (not type) then if args:lower() == "on" then datas = '{ "args": [2,1]}' else datas = '{"args": [0,0]}' end end if type:lower() == "local" then if args:lower() == "on" then datas = '{ "args": [2,0]}' else datas = '{"args": [0,1]}' end end if type:lower() == "rf" then if args:lower() == "on" then datas = '{ "args": [0,1]}' else datas = '{"args": [2,0]}' end end local http = net.HTTPClient() http:request (url, { options = { method = "POST", data = datas }, success = function(response) end, error = function(err) tools.error(err) end }) end end }, si on le code lua qui fonctionne, nous avons : local data = '{"args": [0,0]}' if onOff == "on" then data = '{ "args": [2,1]}' end
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
salut @pepite il y un moment de ça tu m'avais aidée a intégrée une nouvelle option à GEA GEA.add(condition , 30, "Interrupteur Bloquée",{ {"Protection", 452, 2}} GEA.options.protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id, value) if (not id) then id = GEA.currentMainId end if (type(id) ~= "table") then id = {id} end for i=1, #id do fibaro:call(id[i],"setProtection", value) end end }, Option que j'ai intégré a GEA 6.10 sans problème mai voilà aujourd’hui je cherche a offrir a GEA une option de protection plus complète ( Local protection et RF protection*) *Local protection = blocage de l’interrupteur en local *RF protection = blocage de l’interrupteur depuis un smartphone ou autre le code suivant permet d'activée et désactivée Local protection et RF protection mai il fonctionne en method = 'POST' en mettant à jour l'argument d'un module ---Mode Protection active---- SI ---{ "args": [2,0]} uniquelent Local SI ---{ "args": [0,1]} uniquement RF SI ---{ "args": [2,1]} Local et RF Si ---Mode protection inactive--- Si ---{ "args": [0,1]} uniquelent Local SI ---{ "args": [2,0]} uniquelent RF SI ---{ "args": [0,0]} Local et RF ma question comment intégrée ce code ou la méthode a GEA ? local function postMethod(requestUrl, data, successCallback, errorCallback) local http = net.HTTPClient() print (data) http:request(requestUrl, { options = { method = 'POST', headers = {}, data = data, timeout = data.timeout or 5000 }, success = successCallback, error = errorCallback }) end local function fibaroBlindProtection(id, onOff) -- ID , [on/off] local url = 'http://127.0.0.1:11111/api/devices/'..id..'/action/setProtection' ---Mode Protection active---- ---{ "args": [2,0]} uniquelent Local ---{ "args": [0,1]} uniquement RF ---{ "args": [2,1]} Local et RF ---Mode protection inactive ---{ "args": [0,1]} uniquelent Local ---{ "args": [2,0]} uniquelent RF ---{ "args": [0,0]} Local et RF local data = '{"args": [0,0]}' if onOff == "on" then data = '{ "args": [2,1]}' ----Protection active de Local et RF end postMethod(url, data, function(resp) if resp.status < 300 then print('Connection successful, status ' .. resp.status) else print('Connection failed, status ' .. resp.status) end end, function(err) print('error ' .. err) end ) end -- Utilisez fibaroBlindProtection ( deviceID , "on" ou "off") fibaroBlindProtection (123, "on")
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
salut Juste pour savoir si vous avez rajouté cette fonction dans le GEA 6.10 ? GEA.add({"Label", 337, "Label2", "Bloquée"}, 30, "Interupteur Bloquée",{ {"Protection", 452, 2}} GEA.options.protection = {name="Protection", optimize=true, control=function(id) if (not id) then id = GEA.currentMainId end return GEA.options.number.control(id) end, action=function(id, value) if (not id) then id = GEA.currentMainId end if (type(id) ~= "table") then id = {id} end for i=1, #id do fibaro:call(id[i],"setProtection", value) end end },
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
Peut-être qu’il existe un script PHP pour exporter ou exploiter les données de consommations de nos HC2?
-
Merci @Barelle mai effectivement c’est sûr Excel que j’ai le problème Fibaro à tout simplement créée une exportation es données très brute Dans un premier temps, je vais utilisé ta formule pour contrôler mon résultat sur Excel
-
bonjour apres une recherche je ne trouve toujours pas sur le net la bonne formule de conversion de timestamp que généré l'export du tableau énergie dans le fichier exportée j'ai un timestamp 1538875398 en je le convertie avec la formule suivante =C2/ 86400 + 25569 + 2/24 j'ai comme résultat dimanche 7 octobre 2018 et 3:23:18 AM mai je ne suis pas sûr avez-vous la bonne formule pour convertir un timestamp à la bonne date exemple de table exportée : deviceId name timestamp value 67 Clim CH enfants 1538875398 15.2 dimanche 7 octobre 2018 3:23:18 AM 67 Clim CH enfants 1538875399 12.4 dimanche 7 octobre 2018 3:23:19 AM 67 Clim CH enfants 1538875400 10 dimanche 7 octobre 2018 3:23:20 AM merci d'avance
-
merci, mai je laisse tombée pour le moment
- 1 289 réponses
-
- topic unique
-
(et 1 en plus)
Étiqueté avec :
-
j'ai trouver donc je partage si différent de 0 alors envois la valeur de la variable clim globale par mail GEA.add({"Global!", "CLIM", "0"}, 30, "ok", {{"Email", 2, "Ma valeur est #value#"}}) merci
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
j'ai tester ça, mai ça ne fonctionne GEA.add({"Global", "CLIM"}, 30, "ok", {{"Email", 2, "Ma valeur est #value#"}})
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
aiie j'ai pas précisée une variable Global
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
merci chef
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
salut juste une petit question, comment envoyer la valeur d'une variable par mail ? GEA.add( {CONDITIONS}, 30, "", {"Email", 2, "Envoi d"un" mail", "Mail GEA"} ) merci
- 12 330 réponses
-
- support
- script lua
-
(et 1 en plus)
Étiqueté avec :
-
j'avance doucement local line = "les chat de 10%" local r = string.match(line, "(%d+)") fibaro:call(340, 'setValue', r) fibaro:debug(">>>>> " .. r) résultat [DEBUG] 23:14:33: >>>>> 10 et mon volet roulant ID340 ce ferme à 10 % maintenant que j'ai compris comment filtrée une phrase, comment faire pour récupéré une phrase venant de google home et Ifttt avec le code suivant: local params = fibaro:args() fibaro:debug(json.encode(params)) j'ai comme résultat dans mon debug DEBUG] 23:21:29: [{"action":" ouvre le volet roulant à 50 %"}] la grand question est comment récupérée le 50 de la phrase (ouvre le volet roulant à 50 %) ? comment associé la valeur de la phrase (ouvre le volet roulant à 50 %) dans la variable local phrase local phrase = ???????? local r = string.match(phrase, "(%d+)") fibaro:call(340, 'setValue', r) fibaro:debug(">>>>> " .. r) merci d'avance de votre aide
- 1 289 réponses
-
- topic unique
-
(et 1 en plus)
Étiqueté avec :