Assistance with door (gate) open alert

Hi,

I’m trying to setup a alert through the alexa media player service that announces when the back gate has been open for more than 10 seconds.

The announcement ‘action’ works independently if i run it as a service in the developer tools, and i have a binary switch showing the open and closed state on the dashboard to test the sensor itself is working fine.

My automation.yaml is:

- id: '1622996391896'
  alias: Back Gate Open
  description: Notify when back gate open for more than 10 seconds
  trigger:
  - platform: state
    entity_id: binary_sensor.back_gate_ias_zone
    from: Closed
    to: Open
    for:
      seconds: 10
  condition: []
  action:
  - service: notify.alexa_media
    data:
      data:
        type: tts
      message: Back Gate is open
      target:
      - media_player.upstairs
      - media_player.echo_show
      - media_player.lounge
      - media_player.main_bedroom
  mode: single

ANy assistance would be gratefully received!

Carl

Take a look at the state of the binary_sensor in Dev Tools/States.
A binary_sensor can only be on or off.
The device class changes how it is shown in the frontend.

Im looking in states and am not 100% sure what im seeing!

Selecting the gate binary sensor in the drop down it shows the state as off, the yaml below shows the device class as opening. Im not sure that changing those or clicking set state did anything?

Ive tried from: closing to: opening and from:off to on and neither triggered the annoucement.

Carl

Re did with from: off to:on and its now firing the event.

Thanks!