Récupération des infos Domogeek

Bonjour à tous,

suite au bug rencontré dans l’utilisation de Domogeek en intégration REST (cf le post ici ), je me suis lancé dans la création d’un flow Node Red pour avoir la même chose.

voici le flow :

Rien de bien compliqué mais cela donne aussi un exemple de flow qui interroge une API et créé des entité associé.

voici le code que vous pourrez importer.

[{"id":"4fde43da.5e7f14","type":"tab","label":"Domogeek","disabled":false,"info":""},{"id":"cd429050.2c8dc","type":"inject","z":"4fde43da.5e7f14","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 01 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":80,"wires":[["9a9ee779.396548","75df7c0.90fc484","28a58a2b.53dc46","8f94e1c9.f55d48","8af20903.cbc92"]]},{"id":"9a9ee779.396548","type":"http request","z":"4fde43da.5e7f14","name":"Vacances aujoud'hui?","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://domogeek.entropialux.com/schoolholiday/B/now","tls":"","persist":false,"proxy":"","authType":"","x":360,"y":80,"wires":[["c654154a.55d148","4530c5a5.84d574"]]},{"id":"c654154a.55d148","type":"ha-entity","z":"4fde43da.5e7f14","name":"vacances_domogeek_aujourdhui","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"vacances_domogeek_aujourdhui"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":830,"y":60,"wires":[[]]},{"id":"343c1d82.f3f4ea","type":"ha-entity","z":"4fde43da.5e7f14","name":"vacances_domogeek_demain","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"vacances_domogeek_demain"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":820,"y":180,"wires":[[]]},{"id":"ee949256.6652b8","type":"ha-entity","z":"4fde43da.5e7f14","name":"saint_du_jour_domogeek","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"saint_du_jour_domogeek"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":800,"y":300,"wires":[[]]},{"id":"fd358fdb.8567","type":"ha-entity","z":"4fde43da.5e7f14","name":"weekend_domogeek","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"weekend_domogeek"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":790,"y":360,"wires":[[]]},{"id":"d45d927e.070b48","type":"ha-entity","z":"4fde43da.5e7f14","name":"saison_domogeek","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"saison_domogeek"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":780,"y":420,"wires":[[]]},{"id":"75df7c0.90fc484","type":"http request","z":"4fde43da.5e7f14","name":"Vacances demain?","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://domogeek.entropialux.com/schoolholiday/B/tomorrow","tls":"","persist":false,"proxy":"","authType":"","x":360,"y":220,"wires":[["343c1d82.f3f4ea","bbde8b9e.a37928"]]},{"id":"28a58a2b.53dc46","type":"http request","z":"4fde43da.5e7f14","name":"Saint du jour","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://domogeek.entropialux.com/feastedsaint/now","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":300,"wires":[["ee949256.6652b8"]]},{"id":"8f94e1c9.f55d48","type":"http request","z":"4fde43da.5e7f14","name":"Week-End?","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://domogeek.entropialux.com/weekend/now","tls":"","persist":false,"proxy":"","authType":"","x":340,"y":360,"wires":[["fd358fdb.8567"]]},{"id":"8af20903.cbc92","type":"http request","z":"4fde43da.5e7f14","name":"Saison?","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://domogeek.entropialux.com/season","tls":"","persist":false,"proxy":"","authType":"","x":330,"y":420,"wires":[["d45d927e.070b48"]]},{"id":"4530c5a5.84d574","type":"function","z":"4fde43da.5e7f14","name":"","func":"if (msg.payload == 'False') {\n    msg.payload = 'false';\n} else {\n    msg.payload = 'true';\n}\n  \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":120,"wires":[["5c4302bf.572c74"]]},{"id":"bbde8b9e.a37928","type":"function","z":"4fde43da.5e7f14","name":"","func":"if (msg.payload == 'False') {\n    msg.payload = 'false';\n} else {\n    msg.payload = 'true';\n}\n  \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":240,"wires":[["485e10c9.b18d48"]]},{"id":"5c4302bf.572c74","type":"ha-entity","z":"4fde43da.5e7f14","name":"vacances_scolaires_domogeek_aujourdhui","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"binary_sensor","config":[{"property":"name","value":"vacances_scolaires_domogeek_aujourdhui"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":860,"y":120,"wires":[[]]},{"id":"485e10c9.b18d48","type":"ha-entity","z":"4fde43da.5e7f14","name":"vacances_scolaires_domogeek_demain","server":"d718a806.5fa408","version":1,"debugenabled":false,"outputs":1,"entityType":"binary_sensor","config":[{"property":"name","value":"vacances_scolaires_domogeek_demain"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":850,"y":240,"wires":[[]]},{"id":"d718a806.5fa408","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

il ne vous restera plus qu’a changer la zone (A, B, ou C) dans l’url des nodes Vacances aujoud’hui? et Vacances demain?
exemple :
pour la zone B => http://domogeek.entropialux.com/schoolholiday/B/tomorrow
pour la zone A => http://domogeek.entropialux.com/schoolholiday/A/tomorrow

2 J'aime

Merci pour le partage :+1:

1 J'aime

Merci pour le flow et le partage

Ce n’est pas trop le lieu mais je suis en 0.117.6 et aucun problème avec le REST.

Juste pour pas induire en erreur les autres, le bug a dû être corrigé

Merci pour le partage !