@klogg wrote:
I have a really simple requirement so I probably can’t see the woods for the trees…
When an
input_boolean
changes state I need to be notified if asensor
doesn’t also change state after, but within, a very small (almost zero) number of seconds.I have this which I can’t believe is the best way to achieve it (and to be honest I haven’t tested it anyway so it might not even work!)
What am I missing to make this better?
- alias: Warning trigger: - platform: state entity_id: - input_boolean.some_boolean - input_boolean.some_other_boolean action: - wait_template: > {{ as_timestamp(states.sensor.my_sensor.last_changed) - as_timestamp(trigger.now) < 10 }} timeout: seconds: 12 - condition: template > {{ as_timestamp(states.sensor.my_sensor.last_changed) - as_timestamp(trigger.now) > 10 }} - service: notify.blah_blah
Posts: 3
Participants: 3