Need help to have alert to send a notification to Alexa

HI.
I have struggled with alerts, getting it to send a ntificationt when may garage doors have beenopen for a while. I have finally got it work with sending a notification to my phone. However, I would like it to send a notification to my Alexa speakers too.

I have no problem getting notifications to the alexa speakers when it happens in an automation, but I’m not able to do it an alert.

Here’s my code in alerts.yaml:

  garage_door:
    name: Garage is open
    done_message: Garage is closed
    entity_id: sensor.garagdedoor_position
    state: 'open'
    repeat: 5
    can_acknowledge: true
    skip_first: true
    notifiers:
      - mobile_app_sm_n950f

Here’s my code when sending a notification from automation:

  action:
  - service: notify.alexa_media
    data:
      target:
      - media_player.jorn_s_echo_show
      data:
        type: announce
      message: You got visitors
  - service: notify.mobile_app_sm_n950f
    data:
      message: You got visitors

Anybody out here that are able to help me adapt til to the alert routine?

Thanks in advance

https://community.home-assistant.io/t/combining-alerts-with-scripts-or-automations-for-tts-repeating-alerts/63414

@LordHayne
This has been added in 0.117.

https://www.home-assistant.io/integrations/notify.tts/#:~:text=The%20notify%20TTS%20platform%20lets,in%20your%20automations%20and%20alerts.

yes , i know but i didn’t found a way to use it with the echo devices

You could also trigger on the alert.xxx entity changing state to on and then send the notification to the alexa device.

Thanks for your input. While I didn’t get the alert to work with Alexa, I solved it a little different. I made an automation and a script that solved the problem. I will later make the script more generic with arguments. Then I don’t need to make a new for each automation test I’ll do.

  alias: Garagedoor is open
  description: ''
  trigger:
  - platform: state
    entity_id: sensor.garagdedoor_position
    to: open
    for: "00:001:00"
  condition: []
  action:
  - service: script.alexa_announcement
    data: {}
  mode: single

The script is as following:

alexa_announcement:
  alias: Anounce a message
  sequence:
    repeat:
      while:
        - condition: state
          entity_id: 'sensor.garagdedoor_position'
          state: 'open'
      sequence:      
        - delay:
            minutes: 5
        - service: notify.alexa_media
          data:
            target:
              - media_player.jorn_s_echo_show
            data:
              type: announce
            message: The garagedoor is left open
    ```
2 Likes