Intégration Eedomus -> Node-RED

Partagez ici vos astuces et idées d'utilisation d'eedomus

Intégration Eedomus -> Node-RED

Messagepar KikiFUNstyle » 15 Mars 2021 13:20

Voici un exemple pour faire interagir Eedomus avec Node-RED à partir d'un actionneur HTTP :
Node-RED_periph_HTTP_config_1.PNG
Node-RED_periph_HTTP_config_1.PNG (19.41 Kio) Consulté 1267 fois


Node-RED_periph_HTTP_config_2.PNG
Node-RED_periph_HTTP_config_2.PNG (36.09 Kio) Consulté 1267 fois


Mettre le periphId que l'on souhaite envoyer à Node-RED dans valeur brute

Pour les paramètres vous pouvez copier/coller ça sur chaque nouvelle ligne
Code : Tout sélectionner
/pushEedomus?periphId=[RAW_VALUE]&value=[LAST_VALUE PERIPH_ID=[RAW_VALUE]]

dans paramètres

Coté Node-RED :
Voici le flow à importer
Code : Tout sélectionner
[{"id":"8c2f2ff5.7901b","type":"debug","z":"45b4a4fe.34b43c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":420,"wires":[]},{"id":"a1d3ee0f.72148","type":"comment","z":"45b4a4fe.34b43c","name":"916824 - Mouvement salle à manger","info":"","x":620,"y":380,"wires":[]},{"id":"4075ee7b.a7445","type":"http in","z":"45b4a4fe.34b43c","name":"","url":"/pushEedomus","method":"get","upload":false,"swaggerDoc":"","x":130,"y":460,"wires":[["89d7723f.338e8","d27cb40e.6042f8"]]},{"id":"89d7723f.338e8","type":"template","z":"45b4a4fe.34b43c","name":"response","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"success\": 1,\n    \"payload\": {\n        \"periphId\": \"{{payload.periphId}}\",\n        \"value\": \"{{payload.value}}\"\n    }\n}","output":"json","x":180,"y":400,"wires":[["20c30d82.5fa3b2"]]},{"id":"20c30d82.5fa3b2","type":"http response","z":"45b4a4fe.34b43c","name":"","statusCode":"","headers":{},"x":330,"y":400,"wires":[]},{"id":"d27cb40e.6042f8","type":"switch","z":"45b4a4fe.34b43c","name":"","property":"payload.periphId","propertyType":"msg","rules":[{"t":"eq","v":"916824","vt":"str"},{"t":"eq","v":"916825","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":460,"wires":[["8c2f2ff5.7901b"],["c41ae64a.8e3b08"]]},{"id":"c41ae64a.8e3b08","type":"debug","z":"45b4a4fe.34b43c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":520,"wires":[]},{"id":"ef9f2a30.378278","type":"comment","z":"45b4a4fe.34b43c","name":"916825 - Température salle à manger","info":"","x":630,"y":480,"wires":[]}]


Node-RED_flow.PNG
Node-RED_flow.PNG (36.81 Kio) Consulté 1267 fois


Je préfère faire du push Eedomus vers Node-RED afin d'envoyer ce que je souhaite (règles lorsque le périphérique change de valeur par exemple) et non pas du polling Node-RED vers Eedomus.

La node http in permet d'avoir un Endpoint coté Node-RED :)

Pour la suite sur Node-RED :
https://cookbook.nodered.org/
https://nodered.org/docs/
Eedomus+ / ZWave / RFXCom / broadlink RM /Google Mini / Yeelight / Xiaomi Vacuum V1 / Shelly <3
[Store] Shelly
KikiFUNstyle
 
Messages : 700
Inscription : 24 Avr 2014
Localisation : Toulouse

Re: Intégration Eedomus -> Node-RED

Messagepar aldiallo-Edomu » 15 Mars 2021 22:00

Merci!
aldiallo-Edomu
 
Messages : 238
Inscription : 20 Déc 2017

Re: Intégration Eedomus -> Node-RED

Messagepar titi007 » 21 Mars 2021 16:19

Merci,
Faut que je comprenne comment ça fonctionne...
j'étais tombé sur le paquet node-red-eedomus mais je ne vois pas comment l'intégrer via homeassistant!
@kikiFunstyle, je vois que tu es de Toulouse, on est voisin alors, je suis de Balma :P :P
titi007
 
Messages : 115
Inscription : 19 Oct 2014

Re: Intégration Eedomus -> Node-RED

Messagepar KikiFUNstyle » 21 Mars 2021 18:04

titi007 a écrit:Merci,
Faut que je comprenne comment ça fonctionne...
j'étais tombé sur le paquet node-red-eedomus mais je ne vois pas comment l'intégrer via homeassistant!
@kikiFunstyle, je vois que tu es de Toulouse, on est voisin alors, je suis de Balma :P :P

Y'a quand même un prérequis qui t'obliges à installer Node-RED sur une machine (Raspberry, docker, windows, linux ...)

Pour le paquet node-red-contrib-eedomus l0ghan ne l'a pas publié sur npm donc pas disponible depuis la palette Node-RED.

Je vais essayé de faire évoluer son projet afin d'avoir des nodes Eedomus disponible et de publier ça
Eedomus+ / ZWave / RFXCom / broadlink RM /Google Mini / Yeelight / Xiaomi Vacuum V1 / Shelly <3
[Store] Shelly
KikiFUNstyle
 
Messages : 700
Inscription : 24 Avr 2014
Localisation : Toulouse

Re: Intégration Eedomus -> Node-RED

Messagepar BingO » 01 Avr 2021 12:59

Je me suis installé HA sur une VM, je vais poser le module additionel Node-Red dessus et ensuite, documentation pour comprendre comment faire interagir HA et eedomus avec Node-Red au milieu :D
Merci pour ton exemple, ça facilitera la chose je pense :)
BingO
 
Messages : 312
Inscription : 16 Jan 2016

Re: Intégration Eedomus -> Node-RED

Messagepar drobert.68 » 01 Avr 2021 20:33

Bonsoir,

Super ce transfert d'info sur node-red !

Pourrait-on modifier les infos transmises pour rajouter
- le nom du périphérique du type :
&Name=[?NAME? PERIPH_ID=[RAW_VALUE]]
- la pièce du périphérique ? ?ROOM?
- l'usage ?

L'idée est de pouvoir ensuite, suivant l'usage , pousser la donnée sur un infludb ....

Merci
EEDOMUS+ ZIGATE + RFX433 + 5xLC13 + 1xNP201 + 1xFGBS321 + 4xFGK101 + 2xFGMS001 + 2xFGWP011 + 1xZMNHBA2 + 1xZF5201 + 1xSF812
JEEDOM (VM SYNO) + Gateway XIAOMI + BLEA + Aquara + Miflora + Yeelight + Station NETATMO + 2x ECOCompteur
drobert.68
 
Messages : 21
Inscription : 09 Nov 2014
Localisation : Alsace / Haut-Rhin

Re: Intégration Eedomus -> Node-RED

Messagepar KikiFUNstyle » 01 Avr 2021 22:40

drobert.68 a écrit:Bonsoir,

Super ce transfert d'info sur node-red !

Pourrait-on modifier les infos transmises pour rajouter
- le nom du périphérique du type :
&Name=[?NAME? PERIPH_ID=[RAW_VALUE]]
- la pièce du périphérique ? ?ROOM?
- l'usage ?

L'idée est de pouvoir ensuite, suivant l'usage , pousser la donnée sur un infludb ....

Merci

On peut tout faire avec Node-RED ! :geek: :mrgreen:

Coté Eedomus
Capture_eedomus.PNG
Capture_eedomus.PNG (42.02 Kio) Consulté 875 fois

Capture_eedomus_config.PNG
Capture_eedomus_config.PNG (29.21 Kio) Consulté 858 fois


Coté Node-RED
Modifier la node Variables (eedomus_ip, user_api, secret_api)

On donc comme infos à partir d'un periph_id :

Capture_Node-RED.PNG
Capture_Node-RED.PNG (67.4 Kio) Consulté 875 fois


Code : Tout sélectionner
[{"id":"2ff7c4b3.10c0cc","type":"group","z":"6e424c7e.d25704","name":"Récupérer les informations Eedomus à partir de periph_id","style":{"label":true,"stroke":"#ffC000","fill":"#ffefbf","fill-opacity":"0.33","color":"#000000"},"nodes":["b29e82d9.3de54","4fbf39a6.5ca368","a0badef.4ac472","157e3ea2.7f9221","961a8713.481d38","9e3e723b.16d5c","e882e9c1.63aec8","353cc887.cb9368","7973c34a.21a5ec","bdd0c90.1865e38","474a5e6c.82079","e5959952.204638","6628fb8a.88b2c4","2e4bbb5c.bee4c4"],"x":254,"y":79,"w":992,"h":382},{"id":"b29e82d9.3de54","type":"http in","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","url":"/eedomus/nodeRed","method":"get","upload":false,"swaggerDoc":"","x":390,"y":180,"wires":[["4fbf39a6.5ca368","e882e9c1.63aec8"]]},{"id":"4fbf39a6.5ca368","type":"template","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"response","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"success\": 1,\n    \"payload\": {\n        \"periphId\": \"{{payload.periph_id}}\"\n    }\n}","output":"json","x":420,"y":120,"wires":[["a0badef.4ac472"]]},{"id":"a0badef.4ac472","type":"http response","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","statusCode":"","headers":{},"x":570,"y":120,"wires":[]},{"id":"157e3ea2.7f9221","type":"http request","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"periph.list","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://{{ eedomus_ip }}/api/get?api_user={{ api_user }}&api_secret={{ api_secret }}&action=periph.list","tls":"","persist":false,"proxy":"","authType":"","x":660,"y":240,"wires":[["961a8713.481d38"]]},{"id":"961a8713.481d38","type":"function","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"Find periph.list info by periph_id","func":"// find info by periphId\nfor (var periph of msg.payload.body) {\n    if(periph.periph_id === msg.periph_id) {\n        msg.payload = periph;\n        \n        break;\n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":890,"y":240,"wires":[["7973c34a.21a5ec"]]},{"id":"9e3e723b.16d5c","type":"http request","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"periph.caract show_config","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://{{ eedomus_ip }}/api/get?api_user={{ api_user }}&api_secret={{ api_secret }}&action=periph.caract&periph_id={{ periph_id }}&show_config=1","tls":"","persist":false,"proxy":"","authType":"","x":710,"y":300,"wires":[["353cc887.cb9368"]]},{"id":"e882e9c1.63aec8","type":"change","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"Variables","rules":[{"t":"set","p":"eedomus_ip","pt":"msg","to":"EEDOMUS_IP","tot":"str"},{"t":"set","p":"api_user","pt":"msg","to":"API_USER","tot":"str"},{"t":"set","p":"api_secret","pt":"msg","to":"API_SECRET","tot":"str"},{"t":"set","p":"periph_id","pt":"msg","to":"payload.periph_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":180,"wires":[["157e3ea2.7f9221","9e3e723b.16d5c","bdd0c90.1865e38","e5959952.204638"]],"info":"Modifier les variables :\needomus_api= Ip locale de l'eedomus\napi_user=api_user Eedomus\napi_secret=api_secret Eedomus"},{"id":"353cc887.cb9368","type":"debug","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":300,"wires":[]},{"id":"7973c34a.21a5ec","type":"debug","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":240,"wires":[]},{"id":"bdd0c90.1865e38","type":"http request","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"periph.history &show_all- /!\\CLOUD/!\\","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://api.eedomus.com/get?api_user={{ api_user }}&api_secret={{ api_secret }}&action=periph.history&periph_id={{ periph_id }}&show_all=1","tls":"","persist":false,"proxy":"","authType":"","x":750,"y":420,"wires":[["474a5e6c.82079"]]},{"id":"474a5e6c.82079","type":"debug","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":420,"wires":[]},{"id":"e5959952.204638","type":"http request","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"periph.value_list","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://{{ eedomus_ip }}/api/get?api_user={{ api_user }}&api_secret={{ api_secret }}&action=periph.value_list&periph_id={{ periph_id }}&show_config=1","tls":"","persist":false,"proxy":"","authType":"","x":680,"y":360,"wires":[["6628fb8a.88b2c4"]]},{"id":"6628fb8a.88b2c4","type":"debug","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":360,"wires":[]},{"id":"2e4bbb5c.bee4c4","type":"comment","z":"6e424c7e.d25704","g":"2ff7c4b3.10c0cc","name":"<= Changer les variables","info":"","x":810,"y":180,"wires":[]}]


Voilà avec ça tu as toutes les informations que l'on peut récupérer grâce à l'API Eedomus
Eedomus+ / ZWave / RFXCom / broadlink RM /Google Mini / Yeelight / Xiaomi Vacuum V1 / Shelly <3
[Store] Shelly
KikiFUNstyle
 
Messages : 700
Inscription : 24 Avr 2014
Localisation : Toulouse


Retour vers Mes usages

Qui est en ligne ?

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