Alarmo and pending state

Hi to all
I am try to create an automation to play a sound when Alarmo is triggered and will start to be in pending state, but without any success.
Here my code:

- id: '1704566344807'
  alias: Alarmo in pending state
  description: Allarme fired
  trigger:
  - platform: state
    entity_id:
    - alarm_control_panel.alarmo
    attribute: arm_mode
    to: pending
  condition: []
  action:
  - service: media_player.play_media
    target:
      entity_id: media_player.mopidy
    data:
      media_content_id: file:///media/mopidy/media/Allarme_attivato_mario.mp3
      media_content_type: track
    metadata:
      title: Allarme_attivato_mario.mp3
      thumbnail:
      media_class: track
      children_media_class:
      navigateIds:
      - {}
      - media_content_type: library
        media_content_id: library
      - media_content_type: directory
        media_content_id: file:///media/mopidy/media
  mode: single

But it never run.

Thank you for any help

Remove this:

You want the state of the alarm panel, not the value of this attribute.

Thank you, was the solution

1 Like