Aller au contenu

mprinfo

Membres confirmés
  • Compteur de contenus

    14 329
  • Inscription

  • Dernière visite

  • Jours gagnés

    239

Tout ce qui a été posté par mprinfo

  1. Quick App - Bulletin Meteo -- -------------------------------------------------------------------------------------------------------------- -- MeteoAlerte est est script qui va vérifier les alertes méteo du site vigilance.meteofrance.com -- Le site retournant des informations XML, le script va donc les parser. -- Author = "Steven Piccand" -- Version = "V1.40" -- V1.10 - Isolation des éventuelles erreurs -- V1.20 - Envoi possible sur plusieurs smartphones -- V1.30 - Correction problème Main Loop -- V1.40 - Correction status plus ajout personnalisation icone -- V2.00 - Ajout du risque (nouveauté de Météofrance) -- V3.00 - Pour Home center 3 Author = "MPRinfo" -- -------------------------------------------------------------------------------------------------------------- J'ai ajouté les données du QA YR Weather car le QA fibaro ne donne pas la pression atmosphérique Variables à renseigner : Departement = numéro de département Update = Rafraichissement du module en heures NiveauAlerte = valeur de 0 a 5 (indique a partir de quel niveau d'alerte un push doit être envoyer) Push = idTel IDQA_YRWeather = id (id du QA YR Weather) Lien du téléchargement : Bulletin_Meteo_V3.00.fqa
  2. Bientôt disponible sur HC3
  3. Ici c'est ESXI jeedom on s'en fou il y a un topic pour cela
  4. Quick App - UNIFI Moniteur (Adaptation : https://marketplace.fibaro.com/items/unifi-presence)) Quick App va vous permettre de savoir si tout vos appareils UNIFI sont connectés, mais aussi de surveiller des appareils via leurs adresse MAC Présentation visuel que QA Vérification de la version du contrôleur et indication de la connexion Vérifie via l'api le nombre d'appareil adoptés et leurs status dans le contrôleur Envoi un push un appareil unifi est déconnecté et cela a chaque changement d'heure le push s’arrêtera lorsque vous aurez reçu un push comme quoi l'appareil unifi est de nouveau connecté Donne le nombre d' équipement surveiller via l'adresse MAC et le nombre de présent sur le réseau Nombres d' équipement présent (Uniquement ceux avec adresse MAC) Si l'appareil est présent vous aurez une adresse IP Si l'appareil est absent vous aurez une adresse MAC Variables a renseigner Pour frequency je vous conseil de ne pas descendre en dessous de 60s OSUnifi doit être "NON" si vous utilisez un controleur "classique" Configuration des Mac Adresse : il faut allé sur le fichier config du QA --configuration des adresse mac config = config or {} config.listMac = { --------------------------------------------------------------------------------------------------- -- Ne rien modifier au dessus de ce text -- exemple pour ajouter des Mac adresse -- {"DSM ESXI","02:18:ff2:2c:01:23"}, -- {"Doorbird","22:5a:fe:43:47:f1"}, -- seulement les 6 premieres MAC adresse seront affichées dans les labels -- la recherche ce fait sur l'ensemble des Mac adresse -------------------------------------------------------------------------------------------------- {"Exemple 1","00:00:00:00:00:00"}, -------------------------------------------------------------------------------------------------- --Ne rien modifier au dessous de ce text -------------------------------------------------------------------------------------------------- } UniFi_Monitor1.10.fqa
  5. mprinfo

    Petits bug de la HC3

    Le passé c'est du passé le présent me fait vivre et l'avenir (de la HC3) me rend malade
  6. Ca serait bien d'épingler le lien vers la docs officiel fibaro pour les QA est les Scènes
  7. mprinfo

    Petits bug de la HC3

    Guerre aux fautes grammaticale ? Tu sais a mon age le passé est loin d'être simple
  8. mprinfo

    Petits bug de la HC3

    Puisque l'on est dans les bugs a priori le déclanchement d'une scène ce fait à chaque changement de minute donc cela pose un problème avec : interval = 90 -- 1mn 30s qui lui est en secondes exemple : -- DÉCLARATIONS (Conditions/Déclencheurs) { type = "date", property = "cron", operator = "matchInterval", value = { date = { "0", "12", "5", "4", "*", "2019" }, interval = 90 -- 1mn 30s }, isTrigger = true } -- ACTIONS fibaro.debug("Scene1", "Time : "..os.date("%M mn-%S s")) resultat : [28.05.2020] [09:54:33] [DEBUG] [SCENE1]: Time : 54 mn-33 s [28.05.2020] [09:57:00] [DEBUG] [SCENE1]: Time : 57 mn-00 s [28.05.2020] [10:00:00] [DEBUG] [SCENE1]: Time : 00 mn-00 s [28.05.2020] [10:03:00] [DEBUG] [SCENE1]: Time : 03 mn-00 s [28.05.2020] [10:06:00] [DEBUG] [SCENE1]: Time : 06 mn-00 s pour 3mn pour 90s ? autre exemple avvec 2 mm Signaler ce message Posté(e) 28 mai moi je rencontre un bug voici le code : -- DÉCLARATIONS (Conditions/Déclencheurs) { type = "date", property = "cron", operator = "matchInterval", value = { date = { "0", "12", "5", "4", "*", "2019" }, interval = 90 -- 1mn 30s }, isTrigger = true } -- ACTIONS fibaro.debug("Scene1", "Time : "..os.date("%M mn-%S s")) resultat : [28.05.2020] [09:54:33] [DEBUG] [SCENE1]: Time : 54 mn-33 s [28.05.2020] [09:57:00] [DEBUG] [SCENE1]: Time : 57 mn-00 s [28.05.2020] [10:00:00] [DEBUG] [SCENE1]: Time : 00 mn-00 s [28.05.2020] [10:03:00] [DEBUG] [SCENE1]: Time : 03 mn-00 s [28.05.2020] [10:06:00] [DEBUG] [SCENE1]: Time : 06 mn-00 s pour 3mn pour 90s ? si je mets 10 s j'ai un interval de 1 mn autre exemple avvec 2 mm { type = "date", property = "cron", operator = "matchInterval", value = { date = { "0", "12", "5", "4", "*", "2019" }, interval = 120 }, isTrigger = true } resultat : [28.05.2020] [10:09:10] [DEBUG] [SCENE1]: Time : 09 mn-10 s [28.05.2020] [10:10:00] [DEBUG] [SCENE1]: Time : 10 mn-00 s [28.05.2020] [10:12:00] [DEBUG] [SCENE1]: Time : 12 mn-00 s [28.05.2020] [10:14:00] [DEBUG] [SCENE1]: Time : 14 mn-00 s [28.05.2020] [10:16:00] [DEBUG] [SCENE1]: Time : 16 mn-00 s [28.05.2020] [10:18:00] [DEBUG] [SCENE1]: Time : 18 mn-00 s [28.05.2020] [10:20:00] [DEBUG] [SCENE1]: Time : 20 mn-00 s [28.05.2020] [10:22:00] [DEBUG] [SCENE1]: Time : 22 mn-00 s [28.05.2020] [10:24:00] [DEBUG] [SCENE1]: Time : 24 mn-00 s On voit que la condition est toujours exécuter à 0s après le lancement, donc - de 2mn pour le premier lancement
  9. mprinfo

    Petits bug de la HC3

    @lazer sur HC2 si je clique sur la croix le module et les enfants sont supprimer j'ai essayé sur le parent aucun succès
  10. @moicphil pour le moment je laisserai comme cela on verra bien ensuite enfin je suis comme toi je sais pas trop c'est vrai que si tu mets quick app dans HC3 il faudrait mettre aussi Scènes et déclencheur @jojo tu t’ennuie plus de mise a jour sur lifedomus
  11. mprinfo

    Petits bug de la HC3

    @tonyc non sur HC2 tu peux retiré un module qui n'existe plus ou que tu ne veux plus alors si j'ai un module qui crame ou que je reset il reste a vie dans ma HC3 ? Pas besoin de support la HC3 c'est pour jouer. Et ma HC2 n'est pas encore prête a prendre ça retraite
  12. mprinfo

    Petits bug de la HC3

    C'est ce que je fais j'ai inclus un smoke est voila la résultat je l'ai exclus avec ma clef zwave je veux le supprimer je fais un ctrl+F5 il est toujours la NOP sending succeeded. The device has not been removed. Please use Learning Mode to remove it traduction L'envoi du NOP a réussi. L'appareil n'a pas été retiré. Veuillez utiliser le mode d'apprentissage pour le supprimer
  13. mprinfo

    Petits bug de la HC3

    petit bug ou plutôt manque une option pour supprimer un module z-wave il est impossible de supprimer un module sans devoir faire une exclusion Le soucis c'est que si j’exclus le module avec un autre controleur ou simple je fais un reset du module le module va rester a vie dans la HC3
  14. C'est bien ce que je dis [emoji16] Envoyé de mon BLA-L29 en utilisant Tapatalk
  15. Hello esxi 7 ne fonctionne pas sous gen8 Envoyé de mon BLA-L29 en utilisant Tapatalk
  16. Sous debian c'est bon cela fonctionne a chaque fois j'ai pas mal chercher car je sais pas pourquoi il a fallu mettre un \n a la fin de $TOKEN mais cela fonctionne MODEM_IP="192.168.8.1" set echo off curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` # Login LOGIN_REQ="<request><Username>admin</Username><Password>YWRtaW4=</Password><password_type>3</password_type></request>" curl -X POST -d $LOGIN_REQ "http://$MODEM_IP/api/user/login" -H "Cookie: $COOKIE" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: text/xml" --dump-header login_resp_hdr.txt > /dev/null grep "SessionID=" login_resp_hdr.txt | cut -d ':' -f2 | cut -d ';' -f1 > session_id.txt grep "__RequestVerificationTokenone" login_resp_hdr.txt | cut -d ':' -f2 > token.txt SESSION_ID=`cat session_id.txt` TOKEN=`cat token.txt` echo "admin session_id\n$SESSION_ID\n" message_data='<request><Index>-1</Index><Phones><Phone>0637839778</Phone></Phones><Sca></Sca><Content>bonjour</Content><Length>7</Length><Reserved>1</Reserved><Date>1</Date></request>' echo $TOKEN sleep 1 curl -X POST -d $message_data "http://$MODEM_IP/api/sms/send-sms" -H "Cookie: $SESSION_ID" -H "__RequestVerificationToken: $TOKEN\n" -H "Content-Type: text/xml"
  17. je viens de comprendre c'est la liste des tokens les 2 premiers sont extrait response.headers['__RequestVerificationToken'] response.headers['__RequestVerificationTokenone'] response.headers['__RequestVerificationTokentwo'] response.headers['__RequestVerificationToken'] f6Gn4H+VFLWH5rKs8GLAx0WPegbJexoy # tokenone ppvn+Gym61sZi1zHtS2OKqhsrkdtwmuX # tokentwo Sg8LpZVPmNxtVwGOz9zuJBdXgj6VIhGj # /oeu8bb0iW0y4ifyXB9CVpukytGLTMHF # slRpL9Y73aITYreHK2OmXGUlAgvj8PEE # eorIJQcLwc0bdoEIVtlI6doNs+Mxm5qi # p0GvRflZz1nDdfNKAjWi5ziUHCKZjyzG # v3M5a4Ru1lrK9jv4gbFsNexSIAd0kt8m # 3cVd+fi/bWfe6Cdt+ffI4AKLWeGtATz5 # iaOa4xM7tr9lx55h6yDZco8kqRA6JSih # UjHbwgVjtBeFkSG8bGrnkxsnxx1stef0 # 4VymZPatzVsILsLxehqJMjmJJT4C8i2z # Nd1UdIGqlAg2mv57L9hpi4s2ASXPV/TG # sUnsfmik7JCuSJzJ7umIRGmcICNKKE4W # pk93h+F7i3UFJaydUIpeucIags75vZED # 1Oei3S/dnnTkFl3RoFrO+XoA/TD7/xkY # /tw2KJ6FHIvBog54CGKKRcUGbHA4CH1r # TU7ksjRG/5Yv/CLnuhUr9BWD99KvK8gd # 2ZcTOCJNY5P0JgHEsfnEE74c1F4FmQmM # bew3Sj2gKUCOM8rvRbEbEC/bkrXe0vlw # j1rRclNKb2QzAW7jWb8sOaRoKr5yXPCH # U5ntsyW6iGKwonoGwgu6PFIewdnvuU1/ # Bfhxtng78qiGJ9HX8lXqaj4IQGWD80sk # 6meOxzmGsGdh+9HCw7f3uCYilHucx/sM # CIUdMCTf8R85IiJWLmKIEueu/Bpj625b # 63S3dvr6nqnI8P4BVf5+SHWmiQdD0xu8 # ckMs1qfSTxLgnM9FBAxkJ+BZ9XBOvZun # Udkw+97IC1DvaMwIa8s7vp0sxV3mRS0r # +sERIEUctQx7Lf9t7QOaZLWgeNdAgK9X # L0RmzlSV/yx9gfbFnNE8Z1T5LaqrtSZi # Cm9NFeAzJvyu5VuvpdtBYPE++gkwKkNH # XXFe4uWR8OWSKQYK/2nwjU0pZY4xxnsV #
  18. Ca avance plutôt bien via l'api le password et de type 4 donc base64 + SHA256 Je sais pas pourquoi mais cela tombe bien j'arrive a me connecté avec un password type 3 juste le mot de passe en base 64 Je récupère le cookie (SessionID=xxxxxxxxxxxxxxxxxxxxxxxxxxx) et le token comme cela print("/api/webserver/SesTokInfo") self.http:request(self.controller .. "api/webserver/SesTokInfo", { options = { checkCertificate = false, method = 'GET', }, success = function(response) --print(json.encode(response.data)) if response.status == 200 then self.cookie = response.data local len = string.len(self.cookie) print(len) --277 self.Token = string.sub(self.cookie, 221, 252)--SesInfo self.cookie = string.sub(self.cookie, 62, 199)--TokInfo --self.cookie = string.sub(self.cookie, 72, 199) print("Cookie : ",self.cookie) print("Token : ",self.Token) self:loginUnifi(self.cookie) --self:test(self.cookie) end end, error = function(error) self.cookie = nil self:error("checkTitreUnifi() échoué: ", json.encode(error)) self:updateView("Titre", "text", "Controleur UNIFi - checkVersionUnifi() échoué: "..json.encode(error)) end }) pour me connecté avec le mot de passe local LOGIN_REQ = "<request><Username>admin</Username><Password>YWRtaW4=</Password><password_type>3</password_type></request>" self.http:request(self.controller .. "api/user/login", { options = { checkCertificate = false, method = 'POST', headers = { ['Cookie'] = self.cookie , ["content-type"] = "text/xml", ['__RequestVerificationToken'] = self.Token }, data = LOGIN_REQ }, success = function(response) print("*********************************************************************************************************************") print(response.status) print("DATA ---------------------------------------------------------------------------------------------------------------------") print(response.data) if response.status == 200 then --print("response---------------------------------------------------------------------------------------------------------------") --print (json.encode(response)) print("response.headers ------------------------------------------------------------------------------------------------------") for k, v in pairs (response.headers) do print( k.." = "..v ) end print("-----------------------------------") print(response.headers['Set-Cookie']) self.NEWCookie = response.headers['Set-Cookie'] self.RequestVerificationTokenone = response.headers['__RequestVerificationTokenone'] self.RequestVerificationTokentwo = response.headers['__RequestVerificationTokentwo'] self.RequestVerificationToken = response.headers['__RequestVerificationToken'] print(self.NEWCookie) print(self.RequestVerificationTokenone) print(self.RequestVerificationTokentwo) print (self.RequestVerificationToken) --self.cookie = response.headers['Set-Cookie'] --self:debug("loginUnifi() Connecté") self:updateView("Titre", "text", "Routeur 4G (Connecté)") end end, error = function(error) self:updateView("Titre", "text", "Controleur UNIFi - loginUnifi() Erreur: "..json.encode(error)) self:error("loginUnifi() Erreur: ", json.encode(error)) end }) resultat [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: /api/webserver/SesTokInfo [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: 277 [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Cookie : SessionID=7ABN3zTcqPyMUQcdRbY1vxvNhnw5fJLgbr4cLjVlzjeQiMoGDvYIgPHRcoHTfKH2PYgSWi/KVx4u9cbmXzNbzu/jmkcy39zxFFWplmP58kV3cdbgm9mdXnUvqgT0KK2W [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Token : jeZbl+GQq7B/yCWLsNBpss7PPZg/tSRJ [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: ********************************************************************************************************************* [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: 200 [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: DATA --------------------------------------------------------------------------------------------------------------------- [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: OK [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: response.headers ------------------------------------------------------------------------------------------------------ [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Content-Type = text/html [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Server = mini_httpd/1.19 19dec2003 [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Cache-Control = no-cache, no-store [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: __RequestVerificationTokentwo = ppvn+Gym61sZi1zHtS2OKqhsrkdtwmuX [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Date = Thu, 01 Jan 1970 00:00:00 GMT [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Pragma = no-cache [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Connection = close [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Set-Cookie = SessionID=kTSE88RERyta8gOU6dTws/t+PMs88QExc3Av2VyF6lz0E/t6kdm2Shzivb7p3WYo1oZMgfHEKNcaXh874t4V7LFC2UpASG8aSg7cAXWxGbvn8QsynJ8z6ZpnH/q+uAMu;path =/;HttpOnly; [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Content-Length = 61 [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: X-Frame-Options = deny [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: X-Download-Options = noopen [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: Strict-Transport-Security = max-age=31536000; includeSubdomains [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: X-XSS-Protection = 1; mode=block [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: __RequestVerificationTokenone = f6Gn4H+VFLWH5rKs8GLAx0WPegbJexoy [06.06.2020] [08:01:32] [DEBUG] [QUICKAPP30]: __RequestVerificationToken = f6Gn4H+VFLWH5rKs8GLAx0WPegbJexoy#ppvn+Gym61sZi1zHtS2OKqhsrkdtwmuX#Sg8LpZVPmNxtVwGOz9zuJBdXgj6VIhGj#/oeu8bb0iW0y4ifyXB9CVpukytGLTMHF#slRpL9Y73aITYreHK2OmXGUlAgvj8PEE#eorIJQcLwc0bdoEIVtlI6doNs+Mxm5qi#p0GvRflZz1nDdfNKAjWi5ziUHCKZjyzG#v3M5a4Ru1lrK9jv4gbFsNexSIAd0kt8m#3cVd+fi/bWfe6Cdt+ffI4AKLWeGtATz5#iaOa4xM7tr9lx55h6yDZco8kqRA6JSih#UjHbwgVjtBeFkSG8bGrnkxsnxx1stef0#4VymZPatzVsILsLxehqJMjmJJT4C8i2z#Nd1UdIGqlAg2mv57L9hpi4s2ASXPV/TG#sUnsfmik7JCuSJzJ7umIRGmcICNKKE4W#pk93h+F7i3UFJaydUIpeucIags75vZED#1Oei3S/dnnTkFl3RoFrO+XoA/TD7/xkY#/tw2KJ6FHIvBog54CGKKRcUGbHA4CH1r#TU7ksjRG/5Yv/CLnuhUr9BWD99KvK8gd#2ZcTOCJNY5P0JgHEsfnEE74c1F4FmQmM#bew3Sj2gKUCOM8rvRbEbEC/bkrXe0vlw#j1rRclNKb2QzAW7jWb8sOaRoKr5yXPCH#U5ntsyW6iGKwonoGwgu6PFIewdnvuU1/#Bfhxtng78qiGJ9HX8lXqaj4IQGWD80sk#6meOxzmGsGdh+9HCw7f3uCYilHucx/sM#CIUdMCTf8R85IiJWLmKIEueu/Bpj625b#63S3dvr6nqnI8P4BVf5+SHWmiQdD0xu8#ckMs1qfSTxLgnM9FBAxkJ+BZ9XBOvZun#Udkw+97IC1DvaMwIa8s7vp0sxV3mRS0r#+sERIEUctQx7Lf9t7QOaZLWgeNdAgK9X#L0RmzlSV/yx9gfbFnNE8Z1T5LaqrtSZi#Cm9NFeAzJvyu5VuvpdtBYPE++gkwKkNH#XXFe4uWR8OWSKQYK/2nwjU0pZY4xxnsV# si je regarde de plus prêt __RequestVerificationToken f6Gn4H+VFLWH5rKs8GLAx0WPegbJexoy # tokenone ppvn+Gym61sZi1zHtS2OKqhsrkdtwmuX # tokentwo Sg8LpZVPmNxtVwGOz9zuJBdXgj6VIhGj # /oeu8bb0iW0y4ifyXB9CVpukytGLTMHF # slRpL9Y73aITYreHK2OmXGUlAgvj8PEE # eorIJQcLwc0bdoEIVtlI6doNs+Mxm5qi # p0GvRflZz1nDdfNKAjWi5ziUHCKZjyzG # v3M5a4Ru1lrK9jv4gbFsNexSIAd0kt8m # 3cVd+fi/bWfe6Cdt+ffI4AKLWeGtATz5 # iaOa4xM7tr9lx55h6yDZco8kqRA6JSih # UjHbwgVjtBeFkSG8bGrnkxsnxx1stef0 # 4VymZPatzVsILsLxehqJMjmJJT4C8i2z # Nd1UdIGqlAg2mv57L9hpi4s2ASXPV/TG # sUnsfmik7JCuSJzJ7umIRGmcICNKKE4W # pk93h+F7i3UFJaydUIpeucIags75vZED # 1Oei3S/dnnTkFl3RoFrO+XoA/TD7/xkY # /tw2KJ6FHIvBog54CGKKRcUGbHA4CH1r # TU7ksjRG/5Yv/CLnuhUr9BWD99KvK8gd # 2ZcTOCJNY5P0JgHEsfnEE74c1F4FmQmM # bew3Sj2gKUCOM8rvRbEbEC/bkrXe0vlw # j1rRclNKb2QzAW7jWb8sOaRoKr5yXPCH # U5ntsyW6iGKwonoGwgu6PFIewdnvuU1/ # Bfhxtng78qiGJ9HX8lXqaj4IQGWD80sk # 6meOxzmGsGdh+9HCw7f3uCYilHucx/sM # CIUdMCTf8R85IiJWLmKIEueu/Bpj625b # 63S3dvr6nqnI8P4BVf5+SHWmiQdD0xu8 # ckMs1qfSTxLgnM9FBAxkJ+BZ9XBOvZun # Udkw+97IC1DvaMwIa8s7vp0sxV3mRS0r # +sERIEUctQx7Lf9t7QOaZLWgeNdAgK9X # L0RmzlSV/yx9gfbFnNE8Z1T5LaqrtSZi # Cm9NFeAzJvyu5VuvpdtBYPE++gkwKkNH # XXFe4uWR8OWSKQYK/2nwjU0pZY4xxnsV #
  19. La on risque de rigoler même si tu t'appelles jc [emoji1787] Déjà un soucis zwave avec modules en 3.52 tu dois en avoir pas mal je pense Envoyé de mon BLA-L29 en utilisant Tapatalk
  20. Oui je sais pour le script c'est pour montrer comment fonctionne la recherche d'encodage du password bon en curl je viens d'envoyer mes premiers sms Alors j'ai utilisé la méthode pour passord type 3 cela fonctionne avec une erreur merci pour le Base64 MODEM_IP="192.168.8.1"ROUTER_USERNAME="admin"ROUTER_PASSWORD="admin"curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xmlCOOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147`TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41`# LoginLOGIN_REQ="adminYWRtaW4=3"curl -X POST -d $LOGIN_REQ "http://$MODEM_IP/api/user/login" -H "Cookie: $COOKIE" -H "__RequestVerificationToken: $TOKEN" "Content-Type: text/xml" --dump-header login_resp_hdr.txt > /dev/nullgrep "SessionID=" login_resp_hdr.txt | cut -d ':' -f2 | cut -d ';' -f1 > session_id.txtgrep "__RequestVerificationTokenone" login_resp_hdr.txt | cut -d ':' -f2 > token.txtSESSION_ID=`cat session_id.txt`TOKEN=`cat token.txt`echo $TOKENecho "admin session_id\n$SESSION_ID\n"message_data="-10600000000"hello"511" #--compressedcurl -X POST -d $message_data "http://$MODEM_IP/api/sms/send-sms" -H "Cookie: $SESSION_ID" -H "__RequestVerificationToken: $TOKEN"
  21. besoin aide connection routeur 4g Huawei Je viens enfin de réussir a me connecté a l'api de mon routeur E5186 je récupère la SessionID et le Token :http://192.168.8.1/api/webserver/SesTokInfo <?xml version="1.0" encoding="UTF-8"?> <response> <SesInfo>SessionID=JeKxkiXRYojMr/K+dxK0fRL0s+weG1v2wAm79swD1JFv/Ne+1hW3EQCGaJAJf8RGnmqbo7Ij6doAmKzzEzaSS3PqY2suMcucysr2ZpWQanvGcojzA/GEhZEskYdgQL+g</SesInfo> <TokInfo>y3o/pi/wOJrPC75N59B44OiUwRf+QJL9</TokInfo> </response> voici le code pour la home center 3 function QuickApp:SessionID() if self.cookie == nil then print("/api/webserver/SesTokInfo") self.http:request(self.controller .. "api/webserver/SesTokInfo", { options = { checkCertificate = false, method = 'GET', }, success = function(response) --print(json.encode(response.data)) if response.status == 200 then self.cookie = response.data local len = string.len(self.cookie) print(len) --277 self.Token = string.sub(self.cookie, 221, 252)--SesInfo self.cookie = string.sub(self.cookie, 62, 199)--TokInfo --self.cookie = string.sub(self.cookie, 72, 199) print("Cookie : ",self.cookie) print("Token : ",self.Token) --self:loginUnifi(self.cookie) --self:test(self.cookie) end end, error = function(error) self.cookie = nil self:error("checkTitreUnifi() échoué: ", json.encode(error)) self:updateView("Titre", "text", "Controleur UNIFi - checkVersionUnifi() échoué: "..json.encode(error)) end }) end end j'ai 2 variables : self.cookie (SessionID) self.Token (TOKEN) Avec ces 2 variables j'arrive a faire des GET pour récupérer les infos qui n'ont pas besoin d'authentification function QuickApp:API(adresse) if self.cookie ~= nil then print("/device/basic_information", self.cookie ) self.http:request(self.controller..adresse, { options = { checkCertificate = false, method = 'GET', headers = { ['Cookie'] = self.cookie , ["content-type"] = "text/xml", ['__RequestVerificationToken'] = self.Token } }, success = function(response) print(json.encode(response.data)) if response.status == 200 then print(response.data) end end, error = function(error) self.cookie = nil self:error("checkTitreUnifi() échoué: ", json.encode(error)) self:updateView("Titre", "text", "Controleur UNIFi - checkVersionUnifi() échoué: "..json.encode(error)) end }) end end j'appele ces fonctions comme ceci self:SessionID() fibaro.setTimeout(2 * 1000, function() print("-----------------------------------cradle") self:API("api/cradle/status-info") -- adresse mac "1 901 5 0 BC:25:E0:FA:C6:E5" print("-----------------------------------device") self:API("api/device/autorun-version") -- "22.001.07.00.03" self:API("api/device/basic_information") -- version IU web + logiciel "LTE cpe 0 16.100.02.00.03 21.316.01.00.00" self:API("api/device/device-feature-switch") -- 0 1 self:API("api/device/information") ---100003 -- il faut une authentification print("-----------------------------------dialup") self:API("api/dialup/connection")- -- 0600015001 self:API("api/dialup/mobile-dataswitch") -- 1 print("-----------------------------------global") self:API("api/global/module-switch") -- 0 1 1 0 1 1 1 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 print("-----------------------------------language") self:API("api/language/current-language") -- fr print("-----------------------------------monitoring") self:API("api/monitoring/check-notifications") -- UnreadMessage = 0 SmsStorageFull = 0 OnlineUpdateStatus = 14 self:API("api/monitoring/converged-status") -- SimState = 257 SimLockEnable = 0 CurrentLanguage = fr-fr self:API("api/monitoring/status") -- 901 2 101 3 0 0 '10.229.66.187' '172.20.2.39' '172.20.2.10' 0 64 64 2 1 1 101 5 0 1 cpe 0 1 self:API("api/monitoring/traffic-statistics") -- 8743 1637862 79800 0 0 1637862 79800 8743 1 print("-----------------------------------net") self:API("api/net/current-plmn") -- 0 F SFR SFR 20810 7 self:API("api/online-update/upgrade-messagebox") -- 1 self:API("api/pin/status") -- 257 258 3 10 self:API("api/redirection/homepage") -- 0 self:API("api/security/upnp") ---100003 il faut une authentification self:API("api/sms/sms-list") ---100005 self:API("api/user/login") ---100006 self:API("api/user/remind") -- 1 self:API("api/user/session") -- ok self:API("api/user/state-login") -- State = -1 Username = "admin" password_type = 4 self:API("api/wlan/basic-settings") -- Routeur2G 0 0 ALL b/g/n 0 100 32 1 2346 2347 1 100 1 0 0 1 1 600 0 0 0 self:API("api/wlan/multi-switch-settings") self:API("api/wlan/wifi-feature-switch") self:API("api/net/net-mode") self:API("config/lan/config.xml") -- config lan self:API("config/global/config.xml") self:API("config/global/net-type.xml") self:API("config/pcassistant/config.xml") self:API("config/deviceinformation/config.xml") end) On voit que j'arrive a récuperer une grande partie des infos sauf celle qui on besoin d'une authentification Le mot de passe et de type 4 donc il faut base64 et SHA256 j'ai trouver cela mais ca fonctionne pas ROUTER_IP=$1 ROUTER_USERNAME=$2 ROUTER_PASSWORD=$3 # Login CREDENTIALS=`printf $ROUTER_PASSWORD | sha256sum | head -c64 | base64 -w0` echo $CREDENTIALS #CREDENTIALS=`printf "%s%s%s" $ROUTER_USERNAME $CREDENTIALS $TOKEN | sha256sum | head -c64 | base64 -w0` echo $CREDENTIALS DATA=`printf "<request><Username>%s</Username><Password>%s</Password><password_type>4</password_type></request>" $ROUTER_USERNAME $CREDENTIALS` echo $DATA PostRouterData "/api/user/login" "$DATA" voici le script complet #!/bin/sh # Written by oga83 # Check command line parameters if [ "$#" -ne 5 ]; then printf "Syntax: %s <IP> <Username> <Password> <PhoneNumber> <Message>\n" $0 exit 0 fi ROUTER_IP=$1 ROUTER_USERNAME=$2 ROUTER_PASSWORD=$3 SMS_NUMBER=$4 SMS_TEXT=$5 TMP_HEADER_FILE=/tmp/headers.tmp CURL_OPT=--silent ProcessRouterResponseHeader() { # Get token from header NEWTOKEN=`cat $TMP_HEADER_FILE | grep "__RequestVerificationTokenone: " | awk -F' ' '{print $2}'` if [ ! -z "$NEWTOKEN" ]; then TOKEN=$NEWTOKEN; fi NEWTOKEN=`cat $TMP_HEADER_FILE | grep "__RequestVerificationToken: " | awk -F' ' '{print $2}'` if [ ! -z "$NEWTOKEN" ]; then TOKEN=$NEWTOKEN; fi NEWSESSIONID=`cat $TMP_HEADER_FILE | grep "Set-Cookie: SessionID=" | awk -F' ' '{print $2}' | cut -b 1-138` if [ ! -z "$NEWSESSIONID" ]; then SESSIONID=$NEWSESSIONID; fi echo $NEWTOKEN } GetRouterData() # Param1: Relative URL { #echo "GET on http://$ROUTER_IP$1" RESPONSE=`curl $CURL_OPT --request GET http://$ROUTER_IP$1 \ --dump-header $TMP_HEADER_FILE \ -H "Cookie: $SESSIONID" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \ ` ProcessRouterResponseHeader } GetSessionToken() # No parameters { # Get SessionID and RequestVerificationToken GetRouterData '/api/webserver/SesTokInfo' SESSIONID="SessionID="`echo "$RESPONSE"| grep -oPm1 "(?<=<SesInfo>)[^<]+"` TOKEN=`echo "$RESPONSE"| grep -oPm1 "(?<=<TokInfo>)[^<]+"` } PostRouterData() # Param1: RelativeUrl, Param2: Data, Param3:bAskNewToken { # Get new token if necessary if [ ! -z $3 ]; then GetSessionToken fi #echo "POST on http://$ROUTER_IP$1 :" $2 RESPONSE=`curl $CURL_OPT --request POST http://$ROUTER_IP$1 \ --dump-header $TMP_HEADER_FILE \ -H "Cookie: $SESSIONID" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \ --data "$2"` ProcessRouterResponseHeader } # Get initial SessionID and RequestVerificationToken GetSessionToken # Login CREDENTIALS=`printf $ROUTER_PASSWORD | sha256sum | head -c64 | base64 -w0` CREDENTIALS=`printf "%s%s%s" $ROUTER_USERNAME $CREDENTIALS $TOKEN | sha256sum | head -c64 | base64 -w0` DATA=`printf "<request><Username>%s</Username><Password>%s</Password><password_type>4</password_type></request>" $ROUTER_USERNAME $CREDENTIALS` PostRouterData "/api/user/login" "$DATA" # Send SMS DATA="<?xml version='1.0' encoding='UTF-8'?><request><Index>-1</Index><Phones><Phone>$SMS_NUMBER</Phone></Phones><Sca></Sca><Content>$SMS_TEXT</Content><Length>${#SMS_TEXT}</Length><Reserved>1</Reserved><Date>`date +'%F %T'`</Date></request>" PostRouterData "/api/sms/send-sms" "$DATA" 1 # Logout PostRouterData "/api/user/logout" "<request><Logout>1</Logout></request>" Merci d'avance pour votre aide
  22. Scene HC3 - sourceTrigger Comment connaitre la source du déclenchement d'une scène Le déclenchement d'une scène est stocker sous forme de table dans sourceTrigger Pour connaitre la source tu déclenchement -- ACTIONS local trigger = sourceTrigger print(json.encode(trigger)) Sauvegarder et lancer l'action resultat : {"property":"execute","id":2,"type":"user"} On voit : property = "execute" -- string id = 2 (2 = compte admin) -- numerique type = "user" --string Comment Utiliser cette table ? Exemple : je veux savoir si la scène est lancer par l'utilisateur local trigger = sourceTrigger if (trigger.property == "execute") then -- declechement manuel print("Scene lancer manuellement par l'utilisateur)") end Exemple : Je veux soir quel utilisateur a lancer la scéne local trigger = sourceTrigger if (trigger.property == "execute") then -- declechement manuel print("Scene lancer manuellement par l'utilisateur) ", trigger.id) end Maintenant que nous savons comment fonction sourceTrigger nous allons voir comment cela fonctionne avec des déclarations Exemple : j'ai un cron qui déclenche la scène toutes les 10 mn je veux connaitre le jour date heure minute de chaque déclenchement --DÉCLARATIONS (Conditions/Déclencheurs) { type = "date", property = "cron", operator = "match", value = {"10,20,20,30,40,50,0", "*", "*", "*", "*","*"} } -- ACTIONS local trigger = sourceTrigger if (trigger.property == "cron") then if (trigger.type=="date") then local Minutes = trigger.value[1] local Heure = trigger.value[2] local Jour = trigger.value[3] local Mois = trigger.value[4] local NomJourNumerique = tonumber(trigger.value[5]) local JourString = {"Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"} local NonJourString = JourString[NomJourNumerique] local Annee = trigger.value[6] print (string.format("%s %s/%s/%s à %s h %s mn", NonJourString,Jour,Mois,Annee,Minutes,Heure)) end end resultat : Vendredi 5/6/2020 à 20 h 10 mn
  23. J'espère qu'elle fonctionne [emoji16]@lazer un peu de travail pour toi un nouveau serial à saisir Envoyé de mon BLA-L29 en utilisant Tapatalk
  24. mprinfo

    Ma HC2 ne démarre plus

    Il suffit de créer un fibaro id avec l'adresse mail est d'y attaché ta box Si elle appartient à un fibaro id il faut demander le transfert Envoyé de mon BLA-L29 en utilisant Tapatalk
×
×
  • Créer...