Good day,
I’m trying to understand Templating a bit better but I’ve stumbled across a bit of a stumbling stone for me.
I want to do an automation that calls a Service if the door is opened under the condition, that that 3 motion sensors showed a certrain state AFTER the door was opened (and closed).
For this I’m trying to compare timestamps.
The door is my trigger. After that I’m setting a Condition as Template where I want to compare the timestamps. Problem is, I know I can compare last_changed
{{ as_timestamp(states.binary_sensor.Sensor1.last_changed)
< as_timestamp(states.binary_sensor.Sensor2.last_changed) }}
but this is not what I want or need. I need to specifically get the timestamp for when the state changed to on.
What am I missing? Could someone show me an example please or hint me a better way to do this?