Echo Devices (Alexa) as Media Player - Testers Needed

buy another dot, put it somewhere in a far away place with low volume.
send the command to that device like:
play my media on xxx

Anyone else getting the media player failed setup after reboot (fixed after manual restart)? Its happened consistently on the last 3 reboots here.

yes. noticed it a few days ago. Have 2 HA installs to different amazon accounts both doing the same thing. I only noticed it because spooks reported every automation that uses alexa notify. A reload of the integration seems to kick it back in.

This appears in the logs:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 594, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/alexa_media/init.py”, line 335, in async_setup_entry
await login.login(cookies=await login.load_cookie())
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/alexapy/alexalogin.py”, line 328, in load_cookie
cookies = pickle.loads(await myfile.read())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/http/cookies.py”, line 312, in setitem
raise CookieError(“Invalid attribute %r” % (K,))
http.cookies.CookieError: Invalid attribute ‘partitioned’

I saw this article on macrumors :frowning:

I got here via a search because I too thought notify.alexa_media would announce to all.

I created an Alexa group (Everywhere) as described above. I used the Alexa Combine Rooms or Groups option because that is the only way I can find to combine speakers, although it won’t let me add a Sonos One to the group. All devices in the group show as online, but sending text content via Developer Tools

service: notify.alexa_media_everywhere
data:
  message: This is a test message

executes successfully but doesn’t play on any ot the devices, although it will if I specify each device individually with notfiy.alexa_media with a target entity.

Is there some other way to do this other than repeating the same notify,alexa_media message for each individual device? I prefer to do the grouping in Alexa if possible.

I use a group and then this

      - service: notify.alexa_media
        continue_on_error: true
        data:
          target:
          - group.echos
          data:
            type: tts
          message: Es ist <emphasis level="moderate">Post</emphasis> gekommen.
1 Like

When targeting Alexa speaker groups, you must use announce as the type.

1 Like

I tried this grouping approach because Alexa wion’t allow me to create groups that include Sonos, but I can’t get your code to produce any result. Here’s the new YAML:

service: notify.alexa_media
continue_on_error: true
data:
  target: 
  - media_player.announcements
  data: 
    type: tts
  message: This is a test.

Do I have to do anything special with the group? Does this require a Notify group?

Which Sonos? One as described above? Did you enable Alexa there? If no, why not? If yes, then you have a Alexa device of this One to groups as well and then the above will work.

Yes, Sonons One with Alexa enabled. What I did was create a media player group that included all the Alexa devices + Sonos One (which is Alexa-enabled but Alexa does not allow it to be added to an Alexa group in the Alexa app).

So to be clear about the YAML you provided, is group.echos a media player group named “echos”? My entity is named media_player.announcements. I also tried group.announcements and neither works for me.

Yes, media player group.

  echos:
    name: Echomania
    icon: mdi:speaker
    entities:
      - media_player.sonos_move
      - media_player.echo

where sonos_move is the alexa media player “in” the move, coming from the alexa integration. And the echo as well.

So the group is a HA defined group of alexa media players, some are amazon devices, some are the players coming out of Sonos.

I post here because this is the Original Alexa Media mega thread and I know many get notifications when it is updated

To those of you that have trouble with the Alexa Media Player crashing when HA starts.

It broke with a path release change in HA in June and no hint of anyone in the HA dev circles that address what they broke. There is a hope it fixes itself next time HA upgrades Python but that is months from now. November or so.

Best work around is to create an automation that reloads the integration after a HA restart. This way the integration comes up 60 seconds after HA has started. I think most can live with that work around for a few months.

Note that the entity name used below has to be replaced by any of your Amazon Echo devices. Any. That makes the entire integration reload.

alias: Reload Alexa Media Player after HA starts
description: Reload Alexa Media Player after HA starts
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - alias: Reload Alexa Media Player integration
    service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: media_player.echo_hallway
    enabled: true
mode: single

Long term all users of this integration need to rethink their TTS solution because other threads on this forum indicates that there is no more development focus. I personally bought 5 Raspberry Pi Zeros 2Ws and 5 Jabra Speak 410s. There are at least 5 alternative ways to implement TTS with this combo and you can also use same combination as Wyoming Satellites. I may sound negative. But. I am thankful for the many years this integration serviced me. But it is also important to communicate to other users to consider more future proof ways.

3 Likes

if any of the other tts would offer what alexa offers me i would have done it as soon as it was available.
sadly enough it isnt.

2 Likes

I don’t understand - There have been 2 updates for this integration in the last week or so.
I don’t have any issues with the integration. It starts and works on every restart of HA.
Please explain your reasoning for your post - what have I missed?

Many of us have an issue where the integration crashes reporting a cookie problem when you restart HA. If you wait one minute and then reload the integration, it always starts like normal. The issue started after a change to HA in June. The 2024.6.2 release I believe. There is hope the issue may be resolved next time HA upgrades Python. There is a dev working on a fix now that may work also. Until then the automation I posted is a work around. The issue is probably depending on which other integration that people have installed as it may alter the startup sequence of HA

hello, i installed through HACS the latest version (v4.12.1) and, once I restart HA and try to add the integration I get this error:
{“message”:“Invalid handler specified”}

Any idea how to solve it? I uninstalled and installed it again several times, I did a hard reset of the PC and I am still getting the same error. Thanks

Hello, I installed the Alexa media player integration. I would like to have a picture card or any type of card on my dashboard to play a certain playlist on Amazon Music when tapped. I saw some code in the docs but I am confused on where that code goes and how it knows my playlists. If someone could help a beginner that would be appreciated!

Not able to login, after homeassistant update 2024.8

Is it only me having this issue ?

1 Like

Thank you so much it worked…