Tts alexa several devices at once

how can I make this automation to send this message to more echo devices? (not just by copy paste to each device, more elegant way, if exists?)

action:
  - service: notify.alexa_media_living_room
    data:
      message: Someone is in the entrance
      data:
        type: tts
mode: single
1 Like

Use notify groups and send your message to group entity, rather than individual echo devices. Notify Group - Home Assistant

Or create a service which takes an external variable as message and put all your echo devices under that service.

As last, create a speaker group in alexa app and send your notification to that group :slight_smile:

1 Like

You can also target more than one echo by using the following service:

      - service: notify.alexa_media
        data:
          target:
            - media_player.livingroom_dot
            - media_player.computer_room_dot
            - media_player.kitchen_dot
            - media_player.master_bedroom_dot
          data:
            type: tts 
          message: Someone is in the entrance

This service call is specific to each echo device:

  - service: notify.alexa_media_living_room
                    ^^^^^^^^^^^^^^^^^^^^^^^

You need to use the notify.alexa_media service call in order to direct the notification to multiple devices.


EDIT

Ninja’d by finity.

1 Like

I have been really struggling trying to figure out how to create a group for all my alexa echo devices for notifications. How would I translate:

service: notify.alexa_media_echo_office
data:
  data:
    type: tts
  message: Hello

Obviously I would not want to pre-fill in the message, but if i wanted to create a notify group with this device in addition to another, how would the yaml look? Unfortunately the template at Group - Home Assistant isn’t helping.

Trying to build a similar generic solution, however, I am not able to get it to work, can someone help? if this works this can be used as a generic notification script Need help with a script to notify multiple devices (Alexa, Google Home, Mobile, Perm notification)

So I realize that this is far from perfect as I, myself, am fairly new to HA and YAML. This may not be the cleanest, most elegant or most efficient, but it does work. When the mailbox has been closed, I have an alert that goes out telling two of my echo devices (in the office and kitchen) to state that the mail has been delivered.

You can customize this for whatever needs you may have (multiple door contacts being opened, instead of closed), temperature alerts, taunting of intruders, whatever, use your imagination.

alias: Mailbox has been closed
description: ""
trigger:
  - type: opened
    platform: device
    device_id: f0cac620b9d2097617c9fb54c90832d1
    entity_id: binary_sensor.mailbox_sensor_state
    domain: binary_sensor
condition: []
action:
  - service: notify.alexa_media_office_echo_2
    data:
      data:
        type: tts
      message: Your mail has been delivered
      target: notify.alexa_media_office_echo_2
  - service: notify.alexa_media_kitchen_echo_2
    data:
      message: Your mail has been delivered
      data:
        type: tts
      target: notify.alexa_media_kitchen_echo_2
mode: single

I entered the three devices in the target field using the UI, but here is the resulting yaml:

  - service: notify.alexa_media
    data:
      target:
      - media_player.living_room_echo_plus
      - media_player.breakfast_echo_show
      - media_player.master_bedroom
      message: <break time="0.5s"/>There is a visitor at the front door.</voice>
      title: Doorbell Pressed
      data:
        type: tts

This is working fine for me.

service: notify.alexa_media
data:
  message: "my very important message"
  target:
    - media_player.bedroom_echo_dot
    - media_player.echo_show
    - media_player.echo_tv
    - media_player.garage_echo_dot
    - media_player.kitchen_echo_screen
    - media_player.office_echo_dot
  data:
    type: announce

5 Likes

Hey guys, sorry new to HA.
How did you know the name of your targets? media_player.??? Where do I find these names but for my devices?

Haha nevermind, the Target field auto-completed options for me and I found it!

Confirm this still works as of June 2023. Was the missing syntax vs other potential solutions I have seen and tried. I finally have this working after 6mos of trying. It will ding the announcement tone before speaking the text.

2 Likes