Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - id: main_bath_door_open_long_time_notify
- alias: main_bath_door_open_long_time_notify
- description: 門開太久發通知
- trigger:
- - entity_id: binary_sensor.door_mainbath_contact
- platform: state
- to: 'on'
- for:
- minutes: 10
- condition: []
- mode: single
- action:
- - repeat:
- while:
- - condition: state
- entity_id: binary_sensor.door_mainbath_contact
- state: 'on'
- # Don't do it too many times
- - condition: template
- value_template: "{{ repeat.index <= 10 }}"
- sequence:
- - service: notify.line_notify
- data:
- message: 門開,趕快關!
- # Wait for sensor to change to 'off' up to 10 minutes before continuing to execute
- - wait_template: "{{ is_state('binary_sensor.door_mainbath_contact', 'off') }}"
- timeout: "00:10:00"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement