Gestion Automatique des volets sous Node-Red (Azimuth)

Bonjour a tous,

Je me penche sur la gestion automatique de mes volets roulants, je vous partage ce que j’ai mis en place pour ceux que cela intéresserais.
En tant qu’ancien jeedomien, j’essaie de me rapprocher pour ceux qui connaissent, du plugin de gestion automatique des volets qui est fortement paramétrable.

Mon besoin principal est la gestion « Azimuth » donc en fonction du soleil, sachant que j’ai 21 volets à automatiser (15 classiques + 6 velux).

Avec une approche un peu différente, je me suis inspiré de " Automatiser ses volets roulants en fonction du soleil été / hiver" et " Gestion des volets sous Node-Red en fonction du soleil, avec offsets paramétrables"

Mon approche générale est de calculer à interval régulier une position automatique (selon certaines règles).

Pour ce faire, je m’appuie donc sur:

  • Mes entités volet (heu bein oui hein! :slight_smile: )
  • L’entité native sun.sun
  • Une entité input_select par volet qui détermine le « mode » dans lequel est le volet (Auto / Auto Forcé / Manuel / Manuel Forcé), qui sera utile par ailleurs si par exemple on veux stopper momentanément les choses, ou relancer à un instant t.
  • Une entité input_number par volet, qui stocke le dernier calcul automatisé d’ouverture (Je positionne ce dernier à -1 lorsque les conditions d’automatisation ne sont pas/plus satisfaites).
    Nb: Pour faciliter les choses, j’ai nommé les entités correspondantes input_number.automatic_cover_xxx et input_select.automatic_cover_xxx avec xxx = l’id de mes volets.
  • Une entité weather pour déterminer l’ouverture en fonction de la météo

Voici le flow node red :


[{"id":"95ecbc95.0554a","type":"inject","z":"89f218d7.aa0978","name":"Every 10 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/10 0-22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":520,"wires":[["d7a5d568.814168","793d8219.413c3c","1db9a926.7248d7","289583d4.90e80c","3312478c.5afc08","8536b819.199ec8","39c75d78.017d22","37a381d6.daca1e","aa37bb31.41bdc8","e3a25d07.93fa9","8d5c3001.f6ea3","4c75d0d0.c4ca8","dc69505e.5d14c","71b185e7.8b152c","46151ee5.be99e","ee630115.8cf07","989ec058.547e4","d12fd595.351738","d1f25df0.a4ce6","3e11173a.1e8b38","ac5b5e16.209fe"]]},{"id":"3d4a6d42.363c12","type":"group","z":"89f218d7.aa0978","name":"Azimuth Determinations","style":{"fill":"#e3f3d3","label":true},"nodes":["fbcf2a56.083e78","3dd06558.4b1c7a","54e3b9ff.b145a8","e11df07c.9b74c","7f92ef8b.db24f","c1be037a.e09d3","9025c67b.9b6858","50f14e0d.81bc6","ee213cef.4a9dd"],"x":1054,"y":419,"w":512,"h":562},{"id":"fbcf2a56.083e78","type":"function","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Is Azimuth","func":"\n\nconst azimuth = global.get('homeassistant.homeAssistant.states[\"sun.sun\"].attributes.azimuth');\nvar ouverture;\nvar is_azimuth;\n\n//        Determine opening\nif (azimuth > msg.azimuth_min && azimuth < msg.azimuth_max) \n    {is_azimuth = true;}\nelse \n    {is_azimuth = false;}\n\n\nmsg.is_azimuth = is_azimuth;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":460,"wires":[["e11df07c.9b74c"]]},{"id":"3dd06558.4b1c7a","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Auto Forced / Auto","property":"input_select[0].state","propertyType":"msg","rules":[{"t":"eq","v":"Auto_Forced","vt":"str"},{"t":"eq","v":"Auto","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1210,"y":760,"wires":[["c1be037a.e09d3"],["9025c67b.9b6858"]]},{"id":"54e3b9ff.b145a8","type":"function","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Opening Determination","func":"\nvar opening_min = msg.opening_min;\nif (opening_min == null) {opening_min = 20;}\nvar opening = 100;\n\n\nif (msg.weather[0].attributes.forecast[0].condition == \"sunny\") \n    {\n    opening = opening_min;\n    }\n    \n\n\nmsg.opening = opening;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1250,"y":560,"wires":[["7f92ef8b.db24f"]]},{"id":"e11df07c.9b74c","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"True?","property":"is_azimuth","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1470,"y":460,"wires":[["54e3b9ff.b145a8"],["1504325c.29f4fe"]]},{"id":"7f92ef8b.db24f","type":"api-call-service","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Save opening","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.automatic_cover_{{id}}","data":"{\"value\":opening}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1220,"y":640,"wires":[["3dd06558.4b1c7a"]]},{"id":"c1be037a.e09d3","type":"api-call-service","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Set Auto","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"{{input_select.0.entity_id}}","data":"{\"option\":\"Auto\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1480,"y":700,"wires":[["422b64c3.68e51c"]]},{"id":"9025c67b.9b6858","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Last Position is -1?","property":"last_position[0].state","propertyType":"msg","rules":[{"t":"eq","v":"-1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":920,"wires":[["ee213cef.4a9dd"],["50f14e0d.81bc6"]]},{"id":"50f14e0d.81bc6","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Current = last?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"last_position[0].state","vt":"msg"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1440,"y":940,"wires":[["422b64c3.68e51c"],["20c02a39.255c36"]]},{"id":"ee213cef.4a9dd","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Current = 100?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1440,"y":860,"wires":[["422b64c3.68e51c"],["20c02a39.255c36"]]},{"id":"74685640.813718","type":"server","name":"Home Assistant","addon":true},{"id":"a3d84fb8.38362","type":"group","z":"89f218d7.aa0978","name":"Covers","style":{"fill":"#e3f3d3","label":true},"nodes":["793d8219.413c3c","6e4f632d.7f698c","445b010a.5d6a7"],"x":348,"y":53,"w":304,"h":1014},{"id":"793d8219.413c3c","type":"change","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"sud","rules":[{"t":"set","p":"id","pt":"msg","to":"sud","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"110","tot":"num"},{"t":"set","p":"azimuth_max","pt":"msg","to":"230","tot":"num"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":520,"wires":[["2533a315.1def9c"]]},{"id":"6e4f632d.7f698c","type":"group","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"Est","style":{"fill":"#ffffbf","label":true},"nodes":["d7a5d568.814168","71b185e7.8b152c","ac5b5e16.209fe","3e11173a.1e8b38","46151ee5.be99e","ee630115.8cf07","989ec058.547e4","d12fd595.351738","d1f25df0.a4ce6"],"x":374,"y":79,"w":232,"h":402},{"id":"d7a5d568.814168","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"vide_sur_sejour","rules":[{"t":"set","p":"id","pt":"msg","to":"vide_sur_sejour","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"83","tot":"num"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"num"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":440,"wires":[["2533a315.1def9c"]]},{"id":"71b185e7.8b152c","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"mezzanine","rules":[{"t":"set","p":"id","pt":"msg","to":"mezzanine","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":400,"wires":[[]]},{"id":"ac5b5e16.209fe","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"escalier","rules":[{"t":"set","p":"id","pt":"msg","to":"escalier","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":360,"wires":[[]]},{"id":"3e11173a.1e8b38","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"cuisine","rules":[{"t":"set","p":"id","pt":"msg","to":"cuisine","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":320,"wires":[[]]},{"id":"46151ee5.be99e","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"sdb","rules":[{"t":"set","p":"id","pt":"msg","to":"sdb","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[[]]},{"id":"ee630115.8cf07","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"anthony","rules":[{"t":"set","p":"id","pt":"msg","to":"vide_sur_sejour","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":240,"wires":[[]]},{"id":"989ec058.547e4","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_sdb","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdb","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"215","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":200,"wires":[["2533a315.1def9c"]]},{"id":"d12fd595.351738","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_chambre_est","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_chambre_est","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"215","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":120,"wires":[["2533a315.1def9c"]]},{"id":"d1f25df0.a4ce6","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_sdj_est","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdj_est","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"215","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":160,"wires":[["2533a315.1def9c"]]},{"id":"445b010a.5d6a7","type":"group","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"Ouest","style":{"fill":"#ffffbf","label":true},"nodes":["1db9a926.7248d7","289583d4.90e80c","3312478c.5afc08","39c75d78.017d22","8536b819.199ec8","37a381d6.daca1e","aa37bb31.41bdc8","e3a25d07.93fa9","8d5c3001.f6ea3","4c75d0d0.c4ca8","dc69505e.5d14c"],"x":374,"y":559,"w":252,"h":482},{"id":"1db9a926.7248d7","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"bureau","rules":[{"t":"set","p":"id","pt":"msg","to":"bureau","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":600,"wires":[["2533a315.1def9c"]]},{"id":"289583d4.90e80c","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"oceane","rules":[{"t":"set","p":"id","pt":"msg","to":"oceane","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":640,"wires":[["2533a315.1def9c"]]},{"id":"3312478c.5afc08","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"parents","rules":[{"t":"set","p":"id","pt":"msg","to":"parents","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":680,"wires":[["2533a315.1def9c"]]},{"id":"39c75d78.017d22","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"sdb2","rules":[{"t":"set","p":"id","pt":"msg","to":"sdb2","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":720,"wires":[["2533a315.1def9c"]]},{"id":"8536b819.199ec8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"salon","rules":[{"t":"set","p":"id","pt":"msg","to":"salon","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"180","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"265","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":760,"wires":[["2533a315.1def9c"]]},{"id":"37a381d6.daca1e","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"sam","rules":[{"t":"set","p":"id","pt":"msg","to":"sam","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"180","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"265","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":800,"wires":[["2533a315.1def9c"]]},{"id":"aa37bb31.41bdc8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"wc","rules":[{"t":"set","p":"id","pt":"msg","to":"wc","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"220","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":840,"wires":[["2533a315.1def9c"]]},{"id":"e3a25d07.93fa9","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"buanderie","rules":[{"t":"set","p":"id","pt":"msg","to":"buanderie","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"180","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"265","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":880,"wires":[["2533a315.1def9c"]]},{"id":"8d5c3001.f6ea3","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_chambre_ouest","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_chambre_ouest","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"150","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1000,"wires":[["2533a315.1def9c"]]},{"id":"4c75d0d0.c4ca8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_escalier","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_escalier","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"150","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":920,"wires":[["2533a315.1def9c"]]},{"id":"dc69505e.5d14c","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_sdj_ouest","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdj_ouest","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"150","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":960,"wires":[["2533a315.1def9c"]]},{"id":"be14a3e1.74fb","type":"group","z":"89f218d7.aa0978","name":"Moving is authorized","style":{"fill":"#e3f3d3","label":true},"nodes":["6ddb7261.bcd37c","422b64c3.68e51c"],"x":1634,"y":659,"w":272,"h":142},{"id":"6ddb7261.bcd37c","type":"api-call-service","z":"89f218d7.aa0978","g":"be14a3e1.74fb","name":"Set Cover Position","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"{{cover.0.entity_id}}","data":"{\"position\":opening}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1790,"y":760,"wires":[[]]},{"id":"422b64c3.68e51c","type":"switch","z":"89f218d7.aa0978","g":"be14a3e1.74fb","name":"Different Position ?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"neq","v":"opening","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1750,"y":700,"wires":[["6ddb7261.bcd37c"]]},{"id":"dd307ce0.a8cf7","type":"group","z":"89f218d7.aa0978","name":"Manual Action detected","style":{"fill":"#e3f3d3","label":true},"nodes":["20c02a39.255c36","3a54ba9a.cd6126"],"x":1634,"y":839,"w":272,"h":142},{"id":"20c02a39.255c36","type":"api-call-service","z":"89f218d7.aa0978","g":"dd307ce0.a8cf7","name":"Set Manual","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"{{input_select.0.entity_id}}","data":"{\"option\":\"Manual\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1730,"y":880,"wires":[["3a54ba9a.cd6126"]]},{"id":"3a54ba9a.cd6126","type":"api-call-service","z":"89f218d7.aa0978","g":"dd307ce0.a8cf7","name":"Last Position = -1","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.automatic_cover_{{id}}","data":"{\"value\": -1}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1790,"y":940,"wires":[[]]},{"id":"e0281d85.666e8","type":"group","z":"89f218d7.aa0978","name":"Daily Reset","style":{"fill":"#e3f3d3","label":true},"nodes":["505dfc38.ac3564","e53f536f.5acf1","f585d702.0bb268","78c48ab5.0b25e4"],"x":1114,"y":119,"w":252,"h":262},{"id":"505dfc38.ac3564","type":"inject","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Every Day @ 10h","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 10 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1250,"y":160,"wires":[["e53f536f.5acf1"]]},{"id":"e53f536f.5acf1","type":"ha-get-entities","z":"89f218d7.aa0978","g":"e0281d85.666e8","server":"74685640.813718","name":"Input_selects","rules":[{"property":"entity_id","logic":"starts_with","value":"input_select.automatic_cover_","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"input_selects","output_results_count":1,"x":1230,"y":220,"wires":[["f585d702.0bb268"]]},{"id":"f585d702.0bb268","type":"switch","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Manual?","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"Manual","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1220,"y":280,"wires":[["78c48ab5.0b25e4"]]},{"id":"78c48ab5.0b25e4","type":"api-call-service","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Set Auto","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"{{payload.entity_id}}","data":"{\"option\":\"Auto\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1220,"y":340,"wires":[[]]},{"id":"e2c11f94.933bf","type":"group","z":"89f218d7.aa0978","name":"Exiting Azimuth","style":{"fill":"#e3f3d3","label":true},"nodes":["7b7580fe.fa75f","ca3832b.21fd7d","1504325c.29f4fe"],"x":1634,"y":419,"w":272,"h":202},{"id":"7b7580fe.fa75f","type":"api-call-service","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Open Cover","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"cover","service":"open_cover","entityId":"{{cover.0.entity_id}}","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1750,"y":580,"wires":[[]]},{"id":"ca3832b.21fd7d","type":"switch","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Current == last position ?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"last_position[0].state","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1770,"y":520,"wires":[["7b7580fe.fa75f"]]},{"id":"1504325c.29f4fe","type":"api-call-service","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Last Position = -1","server":"74685640.813718","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.automatic_cover_{{id}}","data":"{\"value\": -1}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1750,"y":460,"wires":[["ca3832b.21fd7d"]]},{"id":"f69917c1.8b92e8","type":"group","z":"89f218d7.aa0978","name":"Get Entities","style":{"fill":"#e3f3d3","label":true},"nodes":["2533a315.1def9c","2b0e8e2c.a4c022","f107645b.91bd98","198209a1.d03936","74fc100b.0c056"],"x":714,"y":479,"w":272,"h":402},{"id":"2533a315.1def9c","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","server":"74685640.813718","name":"Get Cover","rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"cover.\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"cover","output_results_count":1,"x":800,"y":520,"wires":[["f107645b.91bd98"]]},{"id":"2b0e8e2c.a4c022","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","server":"74685640.813718","name":"Get Input_select","rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"input_select.automatic_cover_\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"input_select","output_results_count":1,"x":840,"y":680,"wires":[["74fc100b.0c056"]]},{"id":"f107645b.91bd98","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","server":"74685640.813718","name":"Get Last Position","rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"input_number.automatic_cover_\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"last_position","output_results_count":1,"x":850,"y":600,"wires":[["2b0e8e2c.a4c022"]]},{"id":"198209a1.d03936","type":"switch","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Auto?","property":"input_select[0].state","propertyType":"msg","rules":[{"t":"cont","v":"Auto","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":840,"wires":[["fbcf2a56.083e78"]]},{"id":"74fc100b.0c056","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","server":"74685640.813718","name":"Get Weather","rules":[{"property":"entity_id","logic":"is","value":"weather.wavrin","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"weather","output_results_count":1,"x":830,"y":760,"wires":[["198209a1.d03936"]]}]

Bloc « Covers »:
Ici je spécifie tous les volets que je souhaite automatiser.
Pour chacun d’entres eux, je spécifie les paramètres nécessaires à ce dernier, à savoir:

  • L’id du volet (qui sera nécessaire pour récupérer l’entité cover, mais également les input_select et input_number précédents)
  • L’azimuth min et max de chaquun d’entres eux (je reviens la dessus ci-dessous)
  • L’ouverture minimale du volet (en fonction du volet, j’ai des besoins différents, par exemple dans le salon, je ne veux pas que le volet descende à moins de 40% car si jamais je suis dehors quand le volet descent, je souhaite pouvoir re rentrer chez moi :), je fais également une différence en fonction de la hauteur totale du volet, ou si c’est un velux)
    Nb: Il est possible d’en ajouter d’autres selon les besoins, j’envisage par exemple d’ajouter un indicateur is_velux, ou encore une élévation minimale.

Bloc « Get Entities »
Ici je vais rechercher dans HA l’ensemble des entités nécessaires

Bloc « Azimuth Determinations »
Ici je fais les différentes déterminations dans le cas d’une gestion Azimuth.

Pour expliquer brièvement les étapes:
Tout d’abord je vérifie que je suis dans l’intervalle de l’Azimuth (c’est à dire que le soleil est orienté pour taper sur la fenêtre).
Puis je calcule l’ouverture cible (pour le moment je fais uniquement du soit 100%, soit valeur minimale paramétrée dans le cas ou il y a du soleil, je n’ai pas encore trouvé le calcul savant pour que cette ouverture soit proportionnelle à l’élévation du soleil, je suis preneur de tout conseil).
Je stocke la valeur calculée, puis,

J’autorise le mouvement si: Je suis en « Auto Forcé », ou que je suis en « Auto » et que le volet est positionné à 100% ou qu’il est positionné comme au dernier calcul, ou qu’il vient tout juste de rentrer dans l’intervalle de l"azimuth (last position = -1).
Sinon, c’est que le volet à été bougé manuellement et que dont il n’a pas à être bougé

Bloc « Existing Azimuth »
Je stocke que les conditions d’azimuth ne sont plus satisfaites (position -1), puis si le volet est à la position precedemment calculée, je l’ouvre.

Bloc « Moving is authorized »
Si le volet n’est pas positionné comme calculé, alors je bouge le volet à la cible calculée

Bloc « Manual action detected »
Je positionne l’input_select sur « Manual », et l’input_number sur -1.

Bloc « Daily Reset »
Tous les jours à heure fixe, je réarme tous les volets qui ont été passés en Manuel. Cela n’affecte pas ceux qui seraient en Manuel Forcé.

L’Azimuth:
Pour revenir un peu sur le sujet, je ne vais pas faire un cours dessus, il y a plein de sites qui le font très bien, mais juste vous donner la démarche que j’ai adoptée pour déterminer mes azimuth min et max.
Dans un premier temps, vous pouvez utiliser l’outil suivant (Calcul de la position du soleil dans le ciel pour chaque localisation à importe quel moment) qui vous donnera un ordre d’idée de départ.
Bon je ne prends plus l’exemple de l’Elysée comme @Yul car visiblement google le foute maintenant, on va donc prendre la mairie de paris sur une fenêtre coté sud:
image

En suite, et en fonction de la configuration de votre maison (arbres, épaisseur des murs, distance des caches moineaux, est ce que la fenêtre est inclinée comme sur un toit…), vous pouvez affiner une valeur qui corresponde au mieux à la configuration physique de votre maison (j’ai pour ma part guetté pendant une semaine le soleil sur mes fenêtres pour optimiser mes valeurs :slight_smile: ).
La même chose est envisageable pour la partie « Elevation », mais je ne me suis pas penché sur la question.

Afin de piloter les modes en cours dans HA, j’ai regrouper cela dans une carte:

Cette solution n’est peut être pas parfaite, mais du moins pour le moment elle fonctionne correctement chez moi depuis quelques jours.

Si vous avez des suggestions d’amélioration, ou des questions, ou encore retours d’expériences similaires avec des supers calculs savants n’hésitez pas!

Ps: En tant que bon informaticien je n’ai pas encore pris assez de temps pour correctement faire ma documentation, donc veuillez m’excusé si je n’ai pas (encore du moins), mis toute la mise en forme dans ce post :slight_smile:

5 « J'aime »

Merci ! ça va me faire une base pour la gestion des volets ici…
j’ai lu très vite et surtout j’ai pas encore joué avec mais ça va pas tarder

1 « J'aime »

HEllo

J’essaie de mettre en place ta solution malheureusement je rencontre un soucis avec les inputs number, j’ai un fichier input number qui les regroupe tous, dois je les renommer ainsi ?
Sachant que mon entité volet pour la cuisine se nomme : cover.bso_cuisine

#BSO node
automatic_cover_cover.bso_cuisine:
    name: bso Cuisine         # un nom
    min: 0                 # une valeur mini
    max: 100                 # une valeur max
    step: 5               # la valeur d'un interval
    mode: slider
    unit_of_measurement: '%'

automatic_cover_cover.bso_salle_a_manger_g:
    name: bso Sam g         # un nom
    min: 0                 # une valeur mini
    max: 100                 # une valeur max
    step: 5               # la valeur d'un interval
    mode: slider
    unit_of_measurement: '%'

Merci beaucoup

Hello,

J’ai également un fichier qui les regroupe tous, pour ma part je n’ai rien mis de plus que le min et le max:


###  Last calculated positions for the covers

automatic_cover_sud:
  min: -10
  max: 100
automatic_cover_escalier:
  min: -10
  max: 100
automatic_cover_cuisine:
  min: -10
  max: 100

Je commence à -10, mais dans les négatifs j’utilise que le -1.

J’ai remis seulement le min et max et j’ai toujours l’erreur :

Invalid config for [input_number]: invalid slug automatic_cover.bso_cuisine (try automatic_cover_bso_cuisine) for dictionary value @ data['input_number']. Got OrderedDict``

Si quelqu’un a une idée. Merci bcp

Le nom de tes objets n’est pas bon (tu as des points dedans).

Comme te le suggère le message d’erreur, tu peux essayer automatic_cover_bso_cuisine au lieu de automatic_cover.bso_cuisine

Merci beaucoup, j ai encore à régler un soucis avec le weather et ça devrai le faire :slight_smile:

Après de multiples essais, je ne parviens pas à faire communiquer les ordres à mes brises soleil.
Les inputs select et number semblent fonctionner car au niveau de la carte ils s activent en fonction de l azimut.
Voici la config pour le bso de la cuisine :

La je ne vois vraiment pas :frowning:

Hello

J ai enfin trouvé pourquoi cela ne fonctionnait pas.

Eureka !!!
Enfin apres plusieurs essais, j ai trouvé l’erreur; au niveau du auto Forcé, il est nommé auto_Forced donc il ne le trouvait pas. Il faut juste le nommer Auto Forcé comme dans le input select.
Si cela peut servir à certains.
Merci à Dapolux pour le travail.

Maintenant, Je souhaiterai ajouté à 16h30 une inclinaison des lamelles pour les BSO, comment puis je faire dans node red?
Merci beaucoup.

Bonjour,

Ce sujet date un peu, mais je suis dans le même cas que toi il y a quelques années. Je passe de Jeedom à HA et j’utilise le plugin Volets de mika-nt28.
Il est hyper complet et j’ai pas encore toutes mes marques sur HA et encore moins sur NodeRed.

Est-ce que tu aurais fait évoluer ton flow depuis l’ouverture de ce post ? Si oui pourrais-tu partager l’évolution ?
Tu parles que tu ne gère pas l’ouverture proportionnel à l’Azimuth, est-ce que ca a changé ? As tu vu cette node pour semble faites pour : blind control · rdmtc/node-red-contrib-sun-position Wiki · GitHub ou node-red-contrib-blindcontroller (node) - Node-RED?

1 « J'aime »

Bonjour @mguyard,

Je n’ai pas vraiment fait évoluer depuis, je partagerai mon dernier flow en rentrant de week end.
En fait je ne me suis pas lancé a gérer une ouverture proportionnelle car je n’en ai pas vu un grand intérêt (dans ma situation), car car finalement le « besoin » d’ouverture partielle est relativement court dans le temps (quelques dizaines de minutes), j’en suis arrivé a la conclusion que ouverture totale/positionnement au mini me suffisait largement.

Perso je suis satisfait de ce fonctionnement, j’ai juste ajusté un peu les paramètres a la configuration de la maison, du coup ca fait un moment que ca répond a mon besoin et que je ne touche a rien.

Les changements a venir seront de paramétrer l’encapsulage global, c’est a dire que pour le moment j’active tout cela l’été, puis l’hiver je desactive, il faut juste que je mette soit un bouton, soit activable manuellement soit piloté en fonction de la meteo ou de la date, mais comme ca reste peu de fois dans l’année, je reste en manuel pour le moment.

1 « J'aime »

Hello @mguyard,

Dsl pour le retard, mais voici le flow que j’utilise:

[{"id":"95ecbc95.0554a","type":"inject","z":"89f218d7.aa0978","d":true,"name":"Every 10 minutes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":520,"wires":[["793d8219.413c3c","19d4e14f.d40b1f","6ba71cad.96a064","80032c27.164a","7f36e92b.633e68","bea133ff.07816","f041e1b.c0d0d2"]]},{"id":"50b9f020416886eb","type":"debug","z":"89f218d7.aa0978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"opening","targetType":"msg","statusVal":"","statusType":"auto","x":1490,"y":440,"wires":[]},{"id":"a3d84fb8.38362","type":"group","z":"89f218d7.aa0978","name":"Covers","style":{"fill":"#e3f3d3","label":true},"nodes":["793d8219.413c3c","6e4f632d.7f698c","445b010a.5d6a7"],"x":308,"y":53,"w":564,"h":1014},{"id":"793d8219.413c3c","type":"change","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"sud","rules":[{"t":"set","p":"id","pt":"msg","to":"sud","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"110","tot":"num"},{"t":"set","p":"azimuth_max","pt":"msg","to":"230","tot":"num"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":520,"wires":[["2533a315.1def9c"]]},{"id":"6e4f632d.7f698c","type":"group","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"Est","style":{"fill":"#ffffbf","label":true},"nodes":["d7a5d568.814168","71b185e7.8b152c","ac5b5e16.209fe","3e11173a.1e8b38","46151ee5.be99e","ee630115.8cf07","989ec058.547e4","d12fd595.351738","d1f25df0.a4ce6","7f36e92b.633e68","bea133ff.07816","f041e1b.c0d0d2"],"x":334,"y":79,"w":512,"h":402},{"id":"d7a5d568.814168","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"vide_sur_sejour","rules":[{"t":"set","p":"id","pt":"msg","to":"vide_sur_sejour","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"83","tot":"num"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"num"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":320,"wires":[["2533a315.1def9c"]]},{"id":"71b185e7.8b152c","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"mezzanine","rules":[{"t":"set","p":"id","pt":"msg","to":"mezzanine","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":360,"wires":[[]]},{"id":"ac5b5e16.209fe","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"escalier","rules":[{"t":"set","p":"id","pt":"msg","to":"escalier","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":440,"wires":[[]]},{"id":"3e11173a.1e8b38","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"cuisine","rules":[{"t":"set","p":"id","pt":"msg","to":"cuisine","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":400,"wires":[[]]},{"id":"46151ee5.be99e","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"sdb","rules":[{"t":"set","p":"id","pt":"msg","to":"sdb","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"10","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":280,"wires":[[]]},{"id":"ee630115.8cf07","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"anthony","rules":[{"t":"set","p":"id","pt":"msg","to":"vide_sur_sejour","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"270","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":240,"wires":[[]]},{"id":"989ec058.547e4","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_sdb","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdb","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":200,"wires":[["2533a315.1def9c"]]},{"id":"d12fd595.351738","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_chambre_est","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_chambre_est","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":120,"wires":[["2533a315.1def9c"]]},{"id":"d1f25df0.a4ce6","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"velux_sdj_est","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdj_est","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":160,"wires":[["2533a315.1def9c"]]},{"id":"7f36e92b.633e68","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"Velux Est","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"215","tot":"str"},{"t":"set","p":"type","pt":"msg","to":"velux","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":160,"wires":[["d12fd595.351738","d1f25df0.a4ce6","989ec058.547e4"]]},{"id":"bea133ff.07816","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"Volets Etage Est","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":280,"wires":[["ee630115.8cf07","46151ee5.be99e","d7a5d568.814168","71b185e7.8b152c"]]},{"id":"f041e1b.c0d0d2","type":"change","z":"89f218d7.aa0978","g":"6e4f632d.7f698c","name":"Volets RDC Est","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"90","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":420,"wires":[["3e11173a.1e8b38","ac5b5e16.209fe"]]},{"id":"445b010a.5d6a7","type":"group","z":"89f218d7.aa0978","g":"a3d84fb8.38362","name":"Ouest","style":{"fill":"#ffffbf","label":true},"nodes":["1db9a926.7248d7","289583d4.90e80c","3312478c.5afc08","39c75d78.017d22","8536b819.199ec8","37a381d6.daca1e","aa37bb31.41bdc8","e3a25d07.93fa9","8d5c3001.f6ea3","4c75d0d0.c4ca8","dc69505e.5d14c","19d4e14f.d40b1f","6ba71cad.96a064","80032c27.164a"],"x":334,"y":559,"w":512,"h":482},{"id":"1db9a926.7248d7","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"bureau","rules":[{"t":"set","p":"id","pt":"msg","to":"bureau","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":600,"wires":[["2533a315.1def9c"]]},{"id":"289583d4.90e80c","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"oceane","rules":[{"t":"set","p":"id","pt":"msg","to":"oceane","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":640,"wires":[["2533a315.1def9c"]]},{"id":"3312478c.5afc08","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"parents","rules":[{"t":"set","p":"id","pt":"msg","to":"parents","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":680,"wires":[["2533a315.1def9c"]]},{"id":"39c75d78.017d22","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"sdb2","rules":[{"t":"set","p":"id","pt":"msg","to":"sdb2","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":720,"wires":[["2533a315.1def9c"]]},{"id":"8536b819.199ec8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"salon","rules":[{"t":"set","p":"id","pt":"msg","to":"salon","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":760,"wires":[["2533a315.1def9c"]]},{"id":"37a381d6.daca1e","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"sam","rules":[{"t":"set","p":"id","pt":"msg","to":"sam","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"25","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":800,"wires":[["2533a315.1def9c"]]},{"id":"aa37bb31.41bdc8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"wc","rules":[{"t":"set","p":"id","pt":"msg","to":"wc","tot":"str"},{"t":"set","p":"azimuth_min","pt":"msg","to":"220","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"40","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":840,"wires":[["2533a315.1def9c"]]},{"id":"e3a25d07.93fa9","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"buanderie","rules":[{"t":"set","p":"id","pt":"msg","to":"buanderie","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":880,"wires":[["2533a315.1def9c"]]},{"id":"8d5c3001.f6ea3","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_chambre_ouest","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_chambre_ouest","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":1000,"wires":[["2533a315.1def9c"]]},{"id":"4c75d0d0.c4ca8","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_escalier","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_escalier","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"20","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":920,"wires":[["2533a315.1def9c"]]},{"id":"dc69505e.5d14c","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"velux_sdj_ouest","rules":[{"t":"set","p":"id","pt":"msg","to":"velux_sdj_ouest","tot":"str"},{"t":"set","p":"opening_min","pt":"msg","to":"15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":960,"wires":[["2533a315.1def9c"]]},{"id":"19d4e14f.d40b1f","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"Volets Etage Ouest","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"205","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":660,"wires":[["1db9a926.7248d7","289583d4.90e80c","3312478c.5afc08","39c75d78.017d22"]]},{"id":"6ba71cad.96a064","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"Volets RDC Ouest","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"180","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":820,"wires":[["8536b819.199ec8","37a381d6.daca1e","aa37bb31.41bdc8","e3a25d07.93fa9"]]},{"id":"80032c27.164a","type":"change","z":"89f218d7.aa0978","g":"445b010a.5d6a7","name":"Velux Ouest","rules":[{"t":"set","p":"azimuth_min","pt":"msg","to":"120","tot":"str"},{"t":"set","p":"azimuth_max","pt":"msg","to":"285","tot":"str"},{"t":"set","p":"type","pt":"msg","to":"velux","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":960,"wires":[["4c75d0d0.c4ca8","dc69505e.5d14c","8d5c3001.f6ea3"]]},{"id":"f69917c1.8b92e8","type":"group","z":"89f218d7.aa0978","name":"Get Entities","style":{"fill":"#e3f3d3","label":true},"nodes":["2533a315.1def9c","2b0e8e2c.a4c022","f107645b.91bd98","198209a1.d03936","74fc100b.0c056"],"x":984,"y":59,"w":282,"h":402},{"id":"2533a315.1def9c","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Get Cover","server":"74685640.813718","version":0,"rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"cover.\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"cover","output_results_count":1,"x":1080,"y":100,"wires":[["f107645b.91bd98"]]},{"id":"2b0e8e2c.a4c022","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Get Input_select","server":"74685640.813718","version":0,"rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"input_select.automatic_cover_\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"input_select","output_results_count":1,"x":1120,"y":260,"wires":[["74fc100b.0c056"]]},{"id":"f107645b.91bd98","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Get Last Position","server":"74685640.813718","version":0,"rules":[{"property":"entity_id","logic":"jsonata","value":"$contains(\t   $entity().entity_id,\t   \"input_number.automatic_cover_\" & id\t)\t","valueType":"jsonata"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"last_position","output_results_count":1,"x":1130,"y":180,"wires":[["2b0e8e2c.a4c022"]]},{"id":"198209a1.d03936","type":"switch","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Auto?","property":"input_select[0].state","propertyType":"msg","rules":[{"t":"cont","v":"Auto","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1190,"y":420,"wires":[["fbcf2a56.083e78"]]},{"id":"74fc100b.0c056","type":"ha-get-entities","z":"89f218d7.aa0978","g":"f69917c1.8b92e8","name":"Get Weather","server":"74685640.813718","version":0,"rules":[{"property":"entity_id","logic":"is","value":"weather.wavrin","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"weather","output_results_count":1,"x":1110,"y":340,"wires":[["198209a1.d03936"]]},{"id":"74685640.813718","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"dd307ce0.a8cf7","type":"group","z":"89f218d7.aa0978","name":"Manual Action detected","style":{"fill":"#e3f3d3","label":true},"nodes":["20c02a39.255c36","3a54ba9a.cd6126"],"x":1534,"y":919,"w":272,"h":142},{"id":"20c02a39.255c36","type":"api-call-service","z":"89f218d7.aa0978","g":"dd307ce0.a8cf7","name":"Set Manual","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["{{input_select.0.entity_id}}"],"data":"{\"option\":\"Manual\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1630,"y":960,"wires":[["3a54ba9a.cd6126"]]},{"id":"3a54ba9a.cd6126","type":"api-call-service","z":"89f218d7.aa0978","g":"dd307ce0.a8cf7","name":"Last Position = -1","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.automatic_cover_{{id}}"],"data":"{\"value\": -1}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1690,"y":1020,"wires":[[]]},{"id":"be14a3e1.74fb","type":"group","z":"89f218d7.aa0978","name":"Moving is authorized","style":{"fill":"#e3f3d3","label":true},"nodes":["6ddb7261.bcd37c","422b64c3.68e51c"],"x":1534,"y":739,"w":272,"h":142},{"id":"6ddb7261.bcd37c","type":"api-call-service","z":"89f218d7.aa0978","g":"be14a3e1.74fb","name":"Set Cover Position","server":"74685640.813718","version":5,"debugenabled":false,"domain":"cover","service":"set_cover_position","areaId":[],"deviceId":[],"entityId":["{{cover.0.entity_id}}"],"data":"{\"position\":opening}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1690,"y":840,"wires":[[]]},{"id":"422b64c3.68e51c","type":"switch","z":"89f218d7.aa0978","g":"be14a3e1.74fb","name":"Different Position ?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"neq","v":"opening","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1650,"y":780,"wires":[["6ddb7261.bcd37c"]]},{"id":"e2c11f94.933bf","type":"group","z":"89f218d7.aa0978","name":"Exiting Azimuth","style":{"fill":"#e3f3d3","label":true},"nodes":["7b7580fe.fa75f","ca3832b.21fd7d","1504325c.29f4fe"],"x":1534,"y":499,"w":272,"h":202},{"id":"7b7580fe.fa75f","type":"api-call-service","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Open Cover","server":"74685640.813718","version":5,"debugenabled":false,"domain":"cover","service":"open_cover","areaId":[],"deviceId":[],"entityId":["{{cover.0.entity_id}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":660,"wires":[[]]},{"id":"ca3832b.21fd7d","type":"switch","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Current == last position ?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"last_position[0].state","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1670,"y":600,"wires":[["7b7580fe.fa75f"]]},{"id":"1504325c.29f4fe","type":"api-call-service","z":"89f218d7.aa0978","g":"e2c11f94.933bf","name":"Last Position = -1","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.automatic_cover_{{id}}"],"data":"{\"value\": -1}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":540,"wires":[["ca3832b.21fd7d"]]},{"id":"3d4a6d42.363c12","type":"group","z":"89f218d7.aa0978","name":"Azimuth Determinations","style":{"fill":"#e3f3d3","label":true},"nodes":["fbcf2a56.083e78","3dd06558.4b1c7a","54e3b9ff.b145a8","e11df07c.9b74c","7f92ef8b.db24f","c1be037a.e09d3","9025c67b.9b6858","50f14e0d.81bc6","ee213cef.4a9dd"],"x":954,"y":499,"w":512,"h":562},{"id":"fbcf2a56.083e78","type":"function","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Is Azimuth","func":"\n\nconst azimuth = global.get('homeassistant.homeAssistant.states[\"sun.sun\"].attributes.azimuth');\nvar ouverture;\nvar is_azimuth;\n\n//        Determine opening\nif (azimuth > msg.azimuth_min && azimuth < msg.azimuth_max) \n    {is_azimuth = true;}\nelse \n    {is_azimuth = false;}\n\n\nmsg.is_azimuth = is_azimuth;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1050,"y":540,"wires":[["e11df07c.9b74c"]]},{"id":"3dd06558.4b1c7a","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Auto Forced / Auto","property":"input_select[0].state","propertyType":"msg","rules":[{"t":"eq","v":"Auto_Forced","vt":"str"},{"t":"eq","v":"Auto","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":840,"wires":[["c1be037a.e09d3"],["9025c67b.9b6858"]]},{"id":"54e3b9ff.b145a8","type":"function","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Opening Determination","func":"\nvar opening_min = msg.opening_min;\nvar elevation_min = msg.elevation_min;\n//var condition = msg.weather[0].attributes.forecast[0].condition;\nvar condition = msg.weather[0].state;\nconst elevation = global.get('homeassistant.homeAssistant.states[\"sun.sun\"].attributes.elevation');\nconst cloud_cover = parseInt(global.get('homeassistant.homeAssistant.states[\"sensor.wavrin_cloud_cover\"].state'));\nif (opening_min == null) {opening_min = 20;}\nif (elevation_min == null) {elevation_min = 18;}\nvar opening = 100;\nvar vr_type = msg.type;\n\n// Weather checks\nvar check_condition;\nif (vr_type == \"velux\")\n    {check_condition = (condition == \"sunny\") || (condition == \"partlycloudy\");}\nelse \n    {check_condition = (condition == \"sunny\") || ((condition == \"partlycloudy\") && (cloud_cover <= 50));}\n\n// Min elevation check\nvar check_elevation = (elevation > elevation_min);\n\n// Result\nif (check_condition & check_elevation)\n    {\n    opening = opening_min;\n    }\n    \n\n\nmsg.opening = opening;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":640,"wires":[["7f92ef8b.db24f","50b9f020416886eb"]]},{"id":"e11df07c.9b74c","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"True?","property":"is_azimuth","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1370,"y":540,"wires":[["54e3b9ff.b145a8"],["1504325c.29f4fe"]]},{"id":"7f92ef8b.db24f","type":"api-call-service","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Save opening","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.automatic_cover_{{id}}"],"data":"{\"value\":opening}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1120,"y":720,"wires":[["3dd06558.4b1c7a"]]},{"id":"c1be037a.e09d3","type":"api-call-service","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Set Auto","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["{{input_select.0.entity_id}}"],"data":"{\"option\":\"Auto\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":780,"wires":[["422b64c3.68e51c"]]},{"id":"9025c67b.9b6858","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Last Position is -1?","property":"last_position[0].state","propertyType":"msg","rules":[{"t":"eq","v":"-1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1090,"y":980,"wires":[["ee213cef.4a9dd"],["50f14e0d.81bc6"]]},{"id":"50f14e0d.81bc6","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Current = last?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"last_position[0].state","vt":"msg"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1340,"y":1020,"wires":[["422b64c3.68e51c"],["20c02a39.255c36"]]},{"id":"ee213cef.4a9dd","type":"switch","z":"89f218d7.aa0978","g":"3d4a6d42.363c12","name":"Current = 100?","property":"cover[0].attributes.current_position","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1340,"y":940,"wires":[["422b64c3.68e51c"],["20c02a39.255c36"]]},{"id":"e0281d85.666e8","type":"group","z":"89f218d7.aa0978","name":"Daily Reset","style":{"fill":"#e3f3d3","label":true},"nodes":["505dfc38.ac3564","e53f536f.5acf1","f585d702.0bb268","78c48ab5.0b25e4"],"x":1534,"y":59,"w":252,"h":262},{"id":"505dfc38.ac3564","type":"inject","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Every Day @ 09h","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 09 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1670,"y":100,"wires":[["e53f536f.5acf1"]]},{"id":"e53f536f.5acf1","type":"ha-get-entities","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Input_selects","server":"74685640.813718","version":0,"rules":[{"property":"entity_id","logic":"starts_with","value":"input_select.automatic_cover_","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"input_selects","output_results_count":1,"x":1650,"y":160,"wires":[["f585d702.0bb268"]]},{"id":"f585d702.0bb268","type":"switch","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Manual?","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"Manual","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1640,"y":220,"wires":[["78c48ab5.0b25e4"]]},{"id":"78c48ab5.0b25e4","type":"api-call-service","z":"89f218d7.aa0978","g":"e0281d85.666e8","name":"Set Auto","server":"74685640.813718","version":5,"debugenabled":false,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["{{payload.entity_id}}"],"data":"{\"option\":\"Auto\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1640,"y":280,"wires":[[]]}]

Je n’ai pas l’impression d’avoir changé quoi que ce soit depuis la version du premier post. (juste là l’injecteur est désactivé par ce que il ne fais pas encore assez chaud pour être en « mode canicule » :).
C’est ce « mode canicule » qu’il faut que je variabilise / boutonnise (ça se dit? :slight_smile: ), bref il faut que je rendre cet aspect la paramétrable et automatisable même si ça change pas si souvent que ça dans l’année.

1 « J'aime »