Alerts - time interval returns zero

Could someone assist with the below, I’d like the Alert to include how long the sensor has been open - I could of sworn it was working (not sure if it was affected by an update) - at the moment it looks like the Alert is basically sending zero minutes because it fired after the last_changed event

  name: The garage door has been left open.
  done_message: "The garage door has been closed. Open for {{ ((((as_timestamp(now()) - as_timestamp(states.binary_sensor.garage_door.last_updated)) % 3600) / 60) | int) }}  minutes."
  entity_id: binary_sensor.garage_door
  state: 'on'
  repeat: 5
  can_acknowledge: True
  skip_first: True
    - telegram_notify
1 Like