Time delay automation not working?

I want to trigger an email when the garage door has been open for 10 minutes - where am I going wrong in this automation? The email is sent immediately when the door is opened, not after 10 mins of the “open (on)” state.

- alias: 'Email when Alexs Garage Doors has been open for 10 mins'
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d0002019a6b
    from: 'off'
    to: 'on'
    state: 'on'
    for:
      seconds: 30
  action:
    service: notify.email
    data:
      message: 'You Muppet'
      title: 'Alex Garage Door is open for over 10 mins'

Try removing state: ‘on’

- alias: 'Email when Alexs Garage Doors has been open for 10 mins'
  trigger:
    platform: state
    entity_id: binary_sensor.door_window_sensor_158d0002019a6b
    from: 'off'
    to: 'on'
    for:
      seconds: 30
  action:
    service: notify.email
    data:
      message: 'You Muppet'
      title: 'Alex Garage Door is open for over 10 mins'

Also, the alert component is designed for exactly this kind of thing.

1 Like

TIL. When was this added?

Alert component was added in 0.38

1 Like

I don’t think I payed attention between 0.32 and 0.62

1 Like

Thanks @Tinkerer that’s it… cheers