Echo Devices (Alexa) as Media Player - Testers Needed

Is it possible to use different languages in automations with notify.alexa_media service?
I am using italian language but i some automations i want to use thai language. If it is possible, how?

I tried this, but it doesn’t work:

  - service: notify.alexa_media
    data:
      target: media_player.echo_plus
      data:
        type: tts
      message: '{{ [ ''ในที่สุดคุณก็อยู่ที่บ้านเจ้าหญิง'' , ''ยินดีต้อนรับความรักของฉันกลับมา''
        , ''วันนี้เป็นอย่างไรบ้าง'' ,           ''สวัสดีฉันหวังว่าคุณจะสนุกไปกับการอยู่ข้างนอก''
        , ''ความนับถือ'' , ] |random }}'
```

AFAIK you can use any language Alexa supports. Thai is IMO none of them.

Ok, thanks, but which is the config to use to have alexa notifications speak in a different language in an automation?

IMO there is no config. You just write it, e.g. khob khun krab instead of using ขอบคุณคับ
But how it sounds when Alexa says it depends on the language Alexa is set to.
For example when it is set to German, English sentences often sounds awful and vice versa.
Not sure the princess would like that :wink:

1 Like

In the documentation it says that the alexa notification service does not support ‘whole house audio’. Is this the same thing as speaker groups created in the Alexa app?

I want to achieve synchronised audio notifications if possible.

You can use the service notify.alexa_media_everywhere to send a notification to all alexa devices. However it will only work with the type: announce:

service: notify.alexa_media_everywhere
data:
  message: This is my message
  data:
    type: announce

This will also work with Alexa speaker groups, again, it must be type: announce.

1 Like

Hi Drew,

This would be great, 'cause until now I use an Alexa speaker group for doing so.
Nevertheless, this service doesn’t exist here:

Error handling message: Unable to find service notify.alexa_media_everywhere

Any Idea?

Two things to check:

  1. Make sure you have an everywhere speaker group in the Alexa app
  2. Make sure you have a media_player.everywhere entity in HA and that it’s not disabled or excluded. If you enable the debug logging on alexa_media.helpers and search for Excluding device, you can discover if any device is being filtered out of AMP.

Does this mean I would have to create the group myself? Well as said, I already use an Alexa group for doing so :wink:

This sounded like it’s a native group service.
Thanks anyway.

Hi can Alex play URL streams like this one: https://somafm.com/secretagent.pls. If so then what is the correct way to configure the option? I read through the Wiki and searched this post but did not find any reference to playing URL streams. Thanks in advance for any suggestions.

You shouldn’t have to create it, but you should rule it out as a possible cause.

This service should have been created automatically by Alexa Media Player. However, it is possible it wasn’t created if the everywhere speaker group either didn’t eist in the Alexa app or it was excluded during configuration of the integration.

From what I have tried, generally you can only stream from sources that have a skill. For SomaFM, if you enable their Alexa skill you can then use a custom command in AMP:

service: media_player.play_media
target:
  entity_id: media_player.my_dot
data:
  media_content_type: custom
  media_content_id: ask soma fm to play secret agent

Thank you I will give it a try!

Is there a way to create a lovelace button that will send the equivalent of the voice command “alexa play music” where she just selects your favorite radio station or your personalized playlist?

You can emulate any command that you would do with your voice by using the custom command type I gave an example of two posts ago.

You can attach that service call to the tap or hold action of a button card.

I do it with the help of the mini-media-player card:

type: horizontal-stack
cards:
  - type: custom:mini-media-player
    name: Livingroom
    shortcuts:
      columns: 1
      buttons:
        - type: service
          name: Lounge
          id: media_player.play_media
          data:
            entity_id: media_player.echo_wohnen
            media_content_id: shuffle my playlist Lounge
            media_content_type: AMAZON_MUSIC
        - type: custom
          name: Milano Lounge
          id: play Milano Lounge on tunein
    artwork: full-cover-fit
    hide:
      volume: false
      power: true
      source: false
      name: false
      info: false
      controls: false
      progress: false
      icon: true
      state_label: true
      media_info: false
    scale: '1'
    entity: media_player.echo_wohnen

First a radio station, second a playlist.


Actually I have 10 button for each.

Hi,
I never excluded anything AMP created. It’s just not there… And I never ever saw such a group in Alexa. All Alexa groups I had to create myself.
So I’ll stick to the “AnnounceAll” group I created myself - by this I have more control anyway.

I just noticed this error when restarting HA. Any ideas? I thought it may have been because the state is actually ‘true’, lower case, but that wasn’t it either.

From here; Home · custom-components/alexa_media_player Wiki · GitHub

Logger: homeassistant.helpers.template
Source: helpers/template.py:1779
First occurred: 10:17:59 AM (4 occurrences)
Last logged: 10:18:09 AM

Template variable warning: No first item, sequence was empty. when rendering '{{ expand('group.echos') | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}'

That warning it generated because, at startup when the sensors are rendered, the last_called attributes of the echo media_player entities isn’t yet defined. You can get rid of the warnings by adding an availability to your sensor configuration. I haven’t tested this, but I think it should work:


###configuration.yaml

template:
  - sensor:
      - name: last_alexa
        state: >
          {{ expand('group.echos') | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}
        availability: >
          {{ expand('group.hf_echos') | selectattr('attributes.last_called','eq', True) | first is defined }}
1 Like

I tried this:

type: button
name: Punk
tap_action:
  action: call-service
  service: media_player.play_media
  target:
    entity_id: media_player.everywhere
  data:
    media_content_type: custom
    media_content_id: play punk music on everywhere group

But I keep getting this error:
Failed to call service media_player/play_media. required key not provided @ data['media_content_type']

What am I doing wrong?