I created this script:
alias: Test
sequence:
- wait_template: >-
{{ states.switch.kitchen_light.state == 'on' and
states.switch.kitchen_light.last_changed < now() - timedelta(seconds=60) }}
timeout: "00:02:00"
continue_on_timeout: false
- service: persistent_notification.create
data:
message: test
mode: single
I expected it to wait until switch.kitchen_light
has been turned on for at least 60 seconds. But if I turn on switch.kitchen_light
, then wait 20 seconds and then run the script, it waits for 60 seconds instead of the expected 40 seconds. Why?