I’m trying to set up an automation to remind me to pick up my kids from various events. I’ve got a calendar called scott_pickup that’s correctly turning on/off as expected. I set up a template sensor that looks at the end time of the event and should be true when it’s less than 20 minutes until the event ends. The expression works as expected in the template dev tool, but the sensor stays false. I’ve tried it with and without the entitiy_id
pickup_window:
friendly_name: Pickup in 20 minutes
entity_id: calendar.scott_pickup
value_template: >
{{is_state("calendar.scott_pickup", "on") and as_timestamp(states.calendar.scott_pickup.attributes.end_time) - as_timestamp(now()) < 1200}}