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

I know this is an old thread, but for some time I have a failing automation saying the automation uses an unknown action: notify.alexa_media

My automation has a number of targets to announce a message in multiple Alexa devices.

My yaml is pretty much the same as post 9 just above, the only difference is that I use type: TTS rather than announce

Iā€™m currently on 2024.8 but I think this hasnā€™t been working for a number of releases now. Is anyone aware if this syntax needs to be updated and why I canā€™t use notify.alexa_media ?

Thanks

Try reloading the config entry using:

service: homeassistant.reload_config_entry
target:
  entity_id: media_player.YOUR_ALEXA_DEVICE

If that fixes the issue, set up an automation to run the service after restart as show here.

Hi thanks for this, unfortunately itā€™s not resolved my issue.

I have a repair item open for an automation that is saying the automation uses an unknown action ā€˜notify.alexa_mediaā€™

The yaml for the automation is below and usually announces when someone is entering the home approach zone.

alias: Person Arriving Home
description: Issues an Alexa notification when people arrive out our home.
trigger:
  - platform: zone
    entity_id:
      - person.person1
      - person.person2etc
    zone: zone.home_approach
    event: enter
condition: []
action:
  - metadata: {}
    data: {}
    target:
      entity_id: timer.outsideactivitylighting
    action: timer.start
  - data:
      target:
        - media_player.office
        - media_player.kitchen
        - media_player.lounge
        - media_player.study
        - media_player.master_bedroom
      data:
        type: tts
        message: "{{trigger.to_state.name}} is about to arrive at home."
    action: notify.alexa_media
mode: single

I also tweaked the syntax as follows but with the same result:

alias: Person Arriving Home
description: Issues an Alexa notification when people arrive out our home.
trigger:
  - platform: zone
    entity_id:
      - person.person1
      - person.person2etc
    zone: zone.home_approach
    event: enter
condition: []
action:
  - action: notify.alexa_media
    metadata: {}
    data:
      message: "{{trigger.to_state.name}} is about to arrive at home."
      target: >-
        media_player.office media_player.kitchen media_player.study
        media_player.lounge media_player.master_bed_tv
mode: single

Do you have Alexa integrated with your HA via Nabu Casa Subscription for using the notify.alexa_media?

Yes, although I have just checked that my external url is a custom one, not the nabu Casa one, so I have just reconfigured my DNS and nabu Casa to use a custom domain. I will check if this has any impact on this in a few hours.

Hi,

I am having the same issue as reported above where none of my automations are sending out alexa_media notifications when I have multiple echos listed.

action: notify.alexa_media
data:
message: Darren! The front door has been opened
target: media_player.office media_player.bedroom_echo
data:
type: announce

if I list a single device it works fine, with with type as ā€œannounceā€ or ā€œttsā€. I have even created a media helper group with the devices listed and it still doesnā€™t send out the notifications if I select that.

any help on resolving this would be greatly appreciated.

AMP = 4.13.2 (with modified manifest.json file to bypass 2FA issue)
HA Core = 2024.9.3
Supervisor = 2024.09.1