Advertisement
Einstine1984

Open gate

Jan 27th, 2023
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.20 KB | Software | 0 0
  1. alias: Open Gate While
  2. description: ""
  3. trigger:
  4.   - platform: zone
  5.     entity_id: person.voskov
  6.     zone: zone.home
  7.     event: enter
  8.   - platform: zone
  9.     entity_id: person.tanya
  10.     zone: zone.home
  11.     event: enter
  12.   - platform: state
  13.     entity_id:
  14.      - binary_sensor.in_car
  15.       - binary_sensor.tanya_in_car
  16.     to: "on"
  17. condition: []
  18. action:
  19.   - repeat:
  20.       while:
  21.         - condition: or
  22.           conditions:
  23.             - condition: and
  24.               conditions:
  25.                 - condition: zone
  26.                   entity_id: person.tanya
  27.                   zone: zone.home
  28.                 - condition: state
  29.                   entity_id: binary_sensor.tanya_in_car
  30.                   state: "on"
  31.             - condition: and
  32.               conditions:
  33.                 - condition: state
  34.                   entity_id: binary_sensor.in_car
  35.                   state: "on"
  36.                 - condition: zone
  37.                   entity_id: person.voskov
  38.                   zone: zone.home
  39.       sequence:
  40.         - service: script.open_gate
  41.           data: {}
  42.         - delay:
  43.             hours: 0
  44.             minutes: 0
  45.             seconds: 11
  46.             milliseconds: 0
  47. mode: single
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement