Template sensor and template dev tool don't agree

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}}

That template will only update when calendar.scott_pickup changes.

now() won’t update the template.

Add entity_id: sensor.time to the template. This will check it and update the template every minute. Assuming you have a time sensor defined:

- platform: time_date
  display_options:
    - 'time'

Ah. That makes sense. I didn’t think about how the calendar.scott_pickup would only change state at the beginning of the event! Thanks.