I am trying to write this automation to notify me if either my patio or front door has been left opened for more than 65 seconds.
If opened for 65 seconds, send a notification, wait 90 seconds, check if the binary_sensor that triggered the automation is now “off”, rinse and repeat.
The problem is the keeps notifying me even after the binary_sensor(s) are off (verified in Developers Tools).
So it seems there is an issue with this part:
until:
# Did it work?
- condition: template
value_template: "{{ trigger.to_state.state == 'off'}}"
Entire automation:
id: test-automation
trigger:
- platform: state
entity_id: binary_sensor.patio_door_sensor
to: 'on'
for:
seconds: 65
- platform: state
entity_id: binary_sensor.front_door_sensor
to: 'on'
for:
seconds: 65
action:
- repeat:
sequence:
- service: notify.mobile_app_iphone
data_template:
title: "Test"
message: "Test msg"
- delay:
seconds: 90
until:
# Did it work?
- condition: template
value_template: "{{ trigger.to_state.state == 'off'}}"
1 post - 1 participant