Tempo et API Domogeek

Solution Ă  base d'un PC et du logiciel Homeseer. Vous trouverez ici les tutos, les discussions sur les plugs-in et les scripts Ă  base de VBasic, ASP, VBScript, etc

Tempo et API Domogeek

Messagede jfla » 26 Sep 2019, 17:11

Bonjour,

Depuis début Septembre, l'API de Domogeek (pour le Tempo) renvoi "None " comme couleur

J'avais installé depuis un certain temps le plugin McsMQTT ainsi que NodeRed sur mon PC de domotique

J’ai donc créer un flow pour avoir les couleurs Tempo dans Homeseer que je vous livre ici:

[{"id":"5254a036.d01518","type":"tab","label":"Tempo EDF","disabled":false,"info":""},{"id":"151bc6d9.0b7dc9","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":1298,"y":74,"wires":[]},{"id":"b24fd468.fd2a9","type":"http request","z":"5254a036.d01518","name":"","method":"GET","ret":"obj","url":"http://api.domogeek.fr/tempoedf/now/json","tls":"","x":604,"y":81,"wires":[["b7eade42.cd5ee8","187da08b.79c867"]]},{"id":"94a5af1.3fd24d","type":"http request","z":"5254a036.d01518","name":"","method":"GET","ret":"obj","url":"http://api.domogeek.fr/tempoedf/tomorrow/json","tls":"","x":604,"y":157,"wires":[["299a2e3a.e2d3ca","187da08b.79c867"]]},{"id":"19820e4b.bb312a","type":"mqtt out","z":"5254a036.d01518","name":"","topic":"TEMPO","qos":"0","retain":"","broker":"a9f3b8c0.77f5d8","x":1197,"y":184,"wires":[]},{"id":"97fbfeba.ef592","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Aujourdui","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":371.5,"y":80,"wires":[["b24fd468.fd2a9"]]},{"id":"64e1550c.d7603c","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Demain","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":367.5,"y":157,"wires":[["94a5af1.3fd24d"]]},{"id":"64b14e5.9a024b","type":"delay","z":"5254a036.d01518","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":195.5,"y":216,"wires":[["64e1550c.d7603c"]]},{"id":"299a2e3a.e2d3ca","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":869,"y":296,"wires":[]},{"id":"b7eade42.cd5ee8","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1291,"y":29,"wires":[]},{"id":"b15df516.e01958","type":"join","z":"5254a036.d01518","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":966,"y":87,"wires":[["151bc6d9.0b7dc9","81bd6ffb.f735b8"]]},{"id":"187da08b.79c867","type":"switch","z":"5254a036.d01518","name":"","property":"payload.tempocolor","propertyType":"msg","rules":[{"t":"cont","v":"BLEU","vt":"str"},{"t":"cont","v":"BLANC","vt":"str"},{"t":"cont","v":"ROUGE","vt":"str"},{"t":"cont","v":"ND","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":821,"y":142,"wires":[["ed3993bb.cecc9","b15df516.e01958"],["b15df516.e01958","ed3993bb.cecc9"],["b15df516.e01958","ed3993bb.cecc9"],["b15df516.e01958","ed3993bb.cecc9"],["9aaf6b4d.7a5b08"]]},{"id":"ed3993bb.cecc9","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1291,"y":130,"wires":[]},{"id":"9aaf6b4d.7a5b08","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":883,"y":234,"wires":[]},{"id":"81bd6ffb.f735b8","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"change","p":"payload.Demain.tempocolor","pt":"msg","from":"ND","fromt":"str","to":"3","tot":"num"},{"t":"change","p":"payload.Demain.tempocolor","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.Demain.tempocolor","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload.Demain.tempocolor","pt":"msg","from":"ROUGE","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"payload.Aujourdui.tempocolor","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.Aujourdui.tempocolor","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload.Aujourdui.tempocolor","pt":"msg","from":"ROUGE","fromt":"str","to":"2","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1109,"y":399,"wires":[["425ebba9.a174ac","19820e4b.bb312a"]]},{"id":"425ebba9.a174ac","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1308,"y":396,"wires":[]},{"id":"fa9a7b01.f0c368","type":"inject","z":"5254a036.d01518","name":"Tempo Midi","topic":"TEMPO2","payload":"","payloadType":"date","repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"x":130,"y":680,"wires":[["ea7d4955.315de8"]]},{"id":"ea7d4955.315de8","type":"function","z":"5254a036.d01518","name":"Date du Jour","func":"\n// Create formatted time\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\n\n\nmsg.payload = yyyy + \"-\" + mm + \"-\" + dd;\nreturn msg;\n","outputs":1,"noerr":0,"x":170,"y":600,"wires":[["70594062.483c08"]]},{"id":"70594062.483c08","type":"moment","z":"5254a036.d01518","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Paris","adjAmount":0,"adjType":"days","adjDir":"add","format":"calendar","locale":"fr_FR","output":"date","outputType":"msg","outTz":"Europe/Paris","x":400,"y":600,"wires":[["e0be0b03.441358"]]},{"id":"e0be0b03.441358","type":"function","z":"5254a036.d01518","name":"Formate URL","func":"msg.formattedtime=msg.payload;\nvar date=msg.formattedtime\nmsg.url = \"https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter=\" + date + \"&TypeAlerte=TEMPO\";\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":600,"wires":[["832fd80c.8dfcd8","21263560.4f64ba"]]},{"id":"832fd80c.8dfcd8","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","x":1120,"y":600,"wires":[]},{"id":"21263560.4f64ba","type":"www-request","z":"5254a036.d01518","name":"","method":"GET","ret":"obj","url":"","follow-redirects":true,"persistent-http":true,"tls":"","x":410,"y":760,"wires":[["ca27ad5d.c5c9e8","9a9858cf.bc11f8","d4fefa1.17f9088"]]},{"id":"9a9858cf.bc11f8","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":690,"y":760,"wires":[]},{"id":"d4fefa1.17f9088","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"change","p":"payload.JourJ.Tempo","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.JourJ.Tempo","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload.JourJ.Tempo","pt":"msg","from":"ROUGE","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"payload.JourJ.Tempo","pt":"msg","from":"ND","fromt":"str","to":"3","tot":"num"},{"t":"change","p":"payload.JourJ1.Tempo","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.JourJ1.Tempo","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload.JourJ1.Tempo","pt":"msg","from":"ROUGE","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"payload.JourJ1.Tempo","pt":"msg","from":"ND","fromt":"str","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":700,"wires":[["758efc21.2f0ea4","d88bb30a.e59748"]]},{"id":"ca27ad5d.c5c9e8","type":"split","z":"5254a036.d01518","name":"","splt":"\\n","spltType":"str","arraySplt":"2","arraySpltType":"len","stream":false,"addname":"topic","x":410,"y":860,"wires":[["7645a011.6c871","8dd159db.1cfca"]]},{"id":"8dd159db.1cfca","type":"switch","z":"5254a036.d01518","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"JourJ","vt":"str"},{"t":"eq","v":"JourJ1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":940,"wires":[["8306c059.21e1"],["ed9084e1.7c8c38"]]},{"id":"758efc21.2f0ea4","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1130,"y":760,"wires":[]},{"id":"d88bb30a.e59748","type":"mqtt out","z":"5254a036.d01518","name":"TEMPO","topic":"","qos":"","retain":"","broker":"a9f3b8c0.77f5d8","x":1140,"y":700,"wires":[]},{"id":"7645a011.6c871","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":860,"wires":[]},{"id":"20b3eaf8.6a8a36","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1150,"y":980,"wires":[]},{"id":"a49fdc4b.54013","type":"debug","z":"5254a036.d01518","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1150,"y":1040,"wires":[]},{"id":"44f64785.9daa8","type":"inject","z":"5254a036.d01518","name":"Tempo Matin","topic":"TEMPO2","payload":"","payloadType":"date","repeat":"","crontab":"05 06 * * *","once":false,"onceDelay":0.1,"x":140,"y":760,"wires":[["ea7d4955.315de8"]]},{"id":"8306c059.21e1","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"change","p":"payload.Tempo","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.Tempo","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":920,"wires":[["20b3eaf8.6a8a36"]]},{"id":"ed9084e1.7c8c38","type":"change","z":"5254a036.d01518","name":"","rules":[{"t":"change","p":"payload.Tempo","pt":"msg","from":"BLEU","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload.Tempo","pt":"msg","from":"BLANC","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":1020,"wires":[["a49fdc4b.54013"]]},{"id":"a9f3b8c0.77f5d8","type":"mqtt-broker","z":"","name":"Nas-Mosquitto","broker":"","port":"1883","clientid":"AVControl","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]


je transforme la couleur reçue en nombre pour afficher des icones de couleur dans les devices Homeseer

Jean-Francois
Portable ACER V3-771G , I7, 4Gb, SSD 256GB + 750GB de disk

Homesser HS3 Pro 3.0.0.435
Plugin enabled:
2.0.40.0: BLLAN, 1.0.3.0: BLShutdown, 2.0.10.0: BLUSBUIRT, 4.8.6.0: BULLET
0.0.0.31: drhsIpPlugIn, 3.3.2.0: mcsMQTT, 3.0.0.69: mcsXap, 3.0.0.14: NetCAM
3.0.1.109: PHLocation, 30.0.0.36: RFXCOM, 5.0.2.0: SCREPOSITORY, 3.0.0.44: X10
0.0.0.11: Yeelight 3P, 3.0.1.210: Z-Wave,
CM11A, 20 SW10,
35 nodes ZWAVE
Reseau 1-Wire 11 DS1920
3 MS13E, 1 RFXCOM RFXTRX433E
Ethernet Livebox4
Nabaztag-Tag
jfla
Dieu de domotique
 
Messages: 346
Inscription: 07 Mar 2004, 16:57
Localisation: Normandie (France)

Retourner vers Homeseer

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité

Copyright © 2011 - Touteladomotique.com - Tous droits rĂ©servĂ©s
Les blogs partenaires : Abavala, Domo-Blog, Domotique34, Maison et Domotique