Mon problème
Bonjour,
Ca faisait un moment que je n’étais pas venu sur le forum !
J’aurai besoin d’aides ou conseils.
J’ai un module zwave contact sec relié au moteur de mon portail qui me permet de l’ouvrir avec home assistant sans problème.
Voilà ce que je cherche à faire :
- Avoir une ouverture automatique du portail quand j’arrive chez moi
- Pouvoir gérer le fait que le portail ne s’ouvre qu’une fois si ma femme et moi rentrons en même temps
- Pouvoir « bloquer » la possibilité d’actionner ce module pendant une période donnée si me femme arrive juste après moi
Pour le point numéro 1, j’ai fait ce flow sur nodered qui fonctionne :
[{"id":"f36bcde304d110ad","type":"mqtt in","z":"9aa5e5bc6c47f765","d":true,"name":"Nico Person","topic":"homeassistant/person/nicolas_ancre/state","qos":"2","datatype":"auto","broker":"fad177fdeed57a80","nl":false,"rap":true,"rh":0,"inputs":0,"x":90,"y":580,"wires":[["d7cac003cee4a695"]]},{"id":"d7cac003cee4a695","type":"switch","z":"9aa5e5bc6c47f765","d":true,"name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"portail","vt":"str"},{"t":"eq","v":"home","vt":"str"},{"t":"regex","v":"'^(not_home|anthon|confort|ecole-pagnol|ecole-paulin|gruissan|lyon|st-sulpice|travail)$'","vt":"jsonata","case":false}],"checkall":"true","repair":false,"outputs":3,"x":270,"y":580,"wires":[["680532729f6d4a9c"],["680532729f6d4a9c"],[]]},{"id":"680532729f6d4a9c","type":"trigger","z":"9aa5e5bc6c47f765","name":"home","op1":"home","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"portail","bytopic":"all","topic":"topic","outputs":1,"x":290,"y":460,"wires":[["4f9a2cf5f6bd0fd2"]]},{"id":"4f9a2cf5f6bd0fd2","type":"delay","z":"9aa5e5bc6c47f765","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":460,"y":460,"wires":[["83f029f4a6eec724"]]},{"id":"83f029f4a6eec724","type":"change","z":"9aa5e5bc6c47f765","name":"Ouverture portail IOS","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\":\"switch.module_portail\"}","tot":"str"},{"t":"set","p":"query.device_type","pt":"msg","to":"switch","tot":"str"},{"t":"set","p":"query.service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":460,"wires":[["2b678cdb4e7e617f"]]},{"id":"fad177fdeed57a80","type":"mqtt-broker","name":"MQTT broker","broker":"10.151.151.223","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}]
Pour le point 2, j’étais parti sur une automatisation pour moi et ma femme et j’essayais de désactiver celle qui n’avait pas été déclenchée en premier pour que le portail ne se bloque pas quand je rentre
alias: Ouverture Portail Nico
description: ''
trigger:
- platform: zone
entity_id: person.nicolas_ancre
zone: zone.home
event: enter
condition: []
action:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.module_portail
mode: single
Couplé avec ce flow nodered
[{"id":"d0b55772d3b4b46c","type":"mqtt in","z":"9aa5e5bc6c47f765","name":"Nico Person","topic":"homeassistant/person/nicolas_ancre/state","qos":"2","datatype":"auto","broker":"fad177fdeed57a80","nl":false,"rap":true,"rh":0,"inputs":0,"x":90,"y":1020,"wires":[["dc5aab408bc759e0"]]},{"id":"dc5aab408bc759e0","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"portail","vt":"str"},{"t":"eq","v":"home","vt":"str"},{"t":"regex","v":"'^(not_home|anthon|confort|ecole-pagnol|ecole-paulin|gruissan|lyon|st-sulpice|travail)$'","vt":"jsonata","case":false}],"checkall":"true","repair":false,"outputs":3,"x":270,"y":1020,"wires":[["64655b16b11b4efe"],["88fe2aa5966c3d8d"],["26454f7bca131acb"]]},{"id":"e9bfc3f66c538ea1","type":"ha-zone","z":"9aa5e5bc6c47f765","name":"Leave Portail","server":"54cb4d65.064874","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entities":["person.nicolas_ancre"],"event":"leave","zones":["zone.portail"],"x":290,"y":920,"wires":[["26454f7bca131acb"]]},{"id":"50b65639db576738","type":"ha-zone","z":"9aa5e5bc6c47f765","name":"Leave Home","server":"54cb4d65.064874","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entities":["person.nicolas_ancre"],"event":"leave","zones":["zone.home"],"x":290,"y":880,"wires":[["5dab87204eb52220"]]},{"id":"88fe2aa5966c3d8d","type":"delay","z":"9aa5e5bc6c47f765","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":500,"y":1000,"wires":[["84c009db267dc9a4"]]},{"id":"64655b16b11b4efe","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"portail","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":920,"wires":[["5dab87204eb52220"]]},{"id":"84c009db267dc9a4","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":670,"y":980,"wires":[["26454f7bca131acb"]]},{"id":"26454f7bca131acb","type":"change","z":"9aa5e5bc6c47f765","name":"Ouvre Portail Nico Off ","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\":\"automation.ouverture_portail_nico\"}","tot":"str"},{"t":"set","p":"query.device_type","pt":"msg","to":"automation","tot":"str"},{"t":"set","p":"query.service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":1032,"wires":[["4175e5873ffa3c9d"]]},{"id":"5dab87204eb52220","type":"change","z":"9aa5e5bc6c47f765","name":"Ouvre Portail Nico On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\":\"automation.ouverture_portail_nico\"}","tot":"str"},{"t":"set","p":"query.device_type","pt":"msg","to":"automation","tot":"str"},{"t":"set","p":"query.service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":920,"wires":[["4175e5873ffa3c9d"]]},{"id":"4175e5873ffa3c9d","type":"link out","z":"9aa5e5bc6c47f765","name":"","links":["935daab0573fa619"],"x":985,"y":975,"wires":[]},{"id":"1dc7e1bb207ec2d6","type":"mqtt in","z":"9aa5e5bc6c47f765","name":"Karine Person","topic":"homeassistant/person/karine_ancre/state","qos":"2","datatype":"auto","broker":"fad177fdeed57a80","nl":false,"rap":true,"rh":0,"inputs":0,"x":90,"y":1460,"wires":[["5ebadba7ce877ffc"]]},{"id":"5ebadba7ce877ffc","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"portail","vt":"str"},{"t":"eq","v":"home","vt":"str"},{"t":"regex","v":"'^(not_home|anthon|confort|ecole-pagnol|ecole-paulin|gruissan|lyon|st-sulpice|travail)$'","vt":"jsonata","case":false}],"checkall":"true","repair":false,"outputs":3,"x":270,"y":1460,"wires":[["5835452081b049e8"],["3dc794fbb1813e25"],["123622e61fc6b261"]]},{"id":"3dc794fbb1813e25","type":"delay","z":"9aa5e5bc6c47f765","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":500,"y":1440,"wires":[["fc49d0ac5130d9db"]]},{"id":"fc49d0ac5130d9db","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":1420,"wires":[["123622e61fc6b261"]]},{"id":"5835452081b049e8","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"portail","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":1360,"wires":[["a68b71710bdedfeb"]]},{"id":"a68b71710bdedfeb","type":"change","z":"9aa5e5bc6c47f765","name":"Ouvre Portail Kainre On","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\":\"automation.ouverture_portail_karine\"}","tot":"str"},{"t":"set","p":"query.device_type","pt":"msg","to":"automation","tot":"str"},{"t":"set","p":"query.service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1360,"wires":[["09af4acbb77eccef"]]},{"id":"123622e61fc6b261","type":"change","z":"9aa5e5bc6c47f765","name":"Ouvre Portail Karine Off ","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\":\"automation.ouverture_portail_karine\"}","tot":"str"},{"t":"set","p":"query.device_type","pt":"msg","to":"automation","tot":"str"},{"t":"set","p":"query.service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":1472,"wires":[["09af4acbb77eccef"]]},{"id":"09af4acbb77eccef","type":"link out","z":"9aa5e5bc6c47f765","name":"","links":["935daab0573fa619"],"x":985,"y":1415,"wires":[]},{"id":"0db25557e956d0fa","type":"mqtt in","z":"9aa5e5bc6c47f765","name":"Nico déclenche l'ouverture du portail","topic":"homeassistant/automation/ouverture_portail_nico/current","qos":"2","datatype":"auto","broker":"fad177fdeed57a80","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":1520,"wires":[["4b7483ebe86c66e6"]]},{"id":"4b7483ebe86c66e6","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":1520,"wires":[["4aa810648288f75a","123622e61fc6b261"]]},{"id":"2c08640379608232","type":"mqtt in","z":"9aa5e5bc6c47f765","name":"Karine déclenche l'ouverture du portail","topic":"homeassistant/automation/ouverture_portail_karine/current","qos":"2","datatype":"auto","broker":"fad177fdeed57a80","nl":false,"rap":true,"rh":0,"inputs":0,"x":170,"y":1640,"wires":[["08bc172d7e400155"]]},{"id":"08bc172d7e400155","type":"switch","z":"9aa5e5bc6c47f765","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":1640,"wires":[["4aa810648288f75a","26454f7bca131acb"]]},{"id":"fad177fdeed57a80","type":"mqtt-broker","name":"MQTT broker","broker":"10.151.151.223","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"54cb4d65.064874","type":"server","name":"Home Assistant","version":1,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Ca ne fonctionne pas… et je ne sais pas pourquoi. Ce qui ne fonctionne pas c’est l’activation ou la désactivation de l’automatisation en fonction de la zone
Pour le point 3, je me suis demandé si je poouvais faire la chose suivante : si j’ouvre le portail, puis-je désactiver l’entité pour une période donnée ? Si oui comment faire ?
Bien entendu si vous avez une méthode plus simple je suis preneur !
Merci pour votre aide !
Ma configuration
System Health
version | core-2022.4.7 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.9.9 |
os_name | Linux |
os_version | 5.10.103-v7l |
arch | armv7l |
timezone | Europe/Paris |
Home Assistant Community Store
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4862 |
Installed Version | 1.24.5 |
Stage | running |
Available Repositories | 1095 |
Downloaded Repositories | 21 |
Home Assistant Cloud
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
Home Assistant Supervisor
host_os | Home Assistant OS 7.6 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2022.04.0 |
docker_version | 20.10.9 |
disk_total | 179.8 GB |
disk_used | 26.0 GB |
healthy | true |
supported | true |
board | rpi4 |
supervisor_api | ok |
version_api | ok |
installed_addons | Terminal & SSH (9.3.0), File editor (5.3.3), FTP (4.5.0), Samba share (9.5.1), Node-RED (11.1.1), Grafana (7.5.2), InfluxDB (4.4.1), Log Viewer (0.13.0), Mosquitto broker (6.0.1), Z-Wave JS to MQTT (0.37.0), deCONZ (6.12.0) |
Dashboards
dashboards | 1 |
---|---|
resources | 16 |
views | 10 |
mode | storage |