Echo Devices (Alexa) as Media Player - Testers Needed

We really need to get this into home assistant community store please

1 Like

Apologies all for the lack of updates; I’ve been playing a new game so haven’t been coding. :wink:

Still broken? If so, would need logs to help debug for you.

Please follow the Wiki instructions exactly. We’ve added files for notify that you may be missing from your system if you had an earlier version. Also please use the forum quote features for showing your configuration.

Is there a pattern to when you get this? For example, are you providing multiple notifications within a short period of time?

Yes; full support will be in 1.3.0 which is staged.

Are you having issues with Home Assistant in general or with the alexa_media_player custom component? I can’t tell from your description but I feel like you may be in the wrong thread.

The media_image_url is only exposed when the media player is not in standby and would be the attribute entity_picture. However, you may not be able to use it because it’s relative to the alexa api and requires a valid cookie to display. I’m not sure how HA parses that data, but I’d suggest checking the front end code.

Already an issue reported, PR merged, and PR staged for 1.3.0.

Thank you for this great component. I tried integrating via HACS but it’s not adding. I believe the problem is that the folder labelled alexa_media must be preceded by custom_components.

So it should look like this:
custom_components/alexa_media

Edit: my mistake. 1.3.0 is not in release yet.

Seen this on Github, this works with current version:

https://github.com/xatr0z/alexa_media_player

true, but it’s a fork. Not the original repo.

This seems to have stopped working for me today. The notify service (using announce) is failing without errors and trying to trigger a routine using the media_player.play_media service fails with this error in the logs:

An error occured accessing AlexaAPI: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 8 column 1 (char 7)',)

Any ideas about what the problem may be?

You’re not logged in anymore. Try deleting the cookie.

Thanks, I deleted the alexa_media.*****.pickle file and it’s working now. I’ve had problems before where I needed to log in again but, on those occasions, it was obvious that there was an issue because all the devices had disappeared. This time they still showed up and it still seemed to be properly showing the playback state of the devices, only routines and announcements appeared to be affected.

Is there any way that this can be caught before it causes a problem, like automatically deleting the file if there is a problem with the login?

1 Like

We actually check on each restart and it should remake the cookie if there’s a problem. However as of right now we don’t have logic if it loses access between restarts. In your specific case, the media player status was still working because the updates are based on a persistent connection but the routines require a new connection.

Thanks for the follow-up… I updated HA to latest version, rebooted and still didnt work, then it somehow started working again the next day! Not sure why.

I wanted to test this out but it seems the github link is down?

The link in the OP is dated, go here: https://github.com/keatontaylor/alexa_media_player/

2 Likes

is there a quick way to announce to all echos? instead of listing each one in a json list. i don’t see anything about it in the docs.

Yes but you need some groups.

What is the correct way to add this to HA? I see there is different solutions.

This is a snippet from my configuration.yaml

group:
  house_talk:
    name: house_talk
    view: no
    entities:
      - media_player.kitchen_echo
      - media_player.livingroom_echo_dot
      - media_player.bedroom_echo_dot
      - media_player.bathroom_echo_dot
      - media_player.guestroom_echo_dot
      - media_player.richard_s_tablet
      - media_player.sandy_s_tablet

Install instructions.

1.3.0 is out.

This version support Guard Mode settings along with various bug fixes. We finally removed the media_player.alexa_tts service. Use the notify component instead.

We’ve swapped to supporting HACS since custom_updater is deprecated. This release should work for custom_updater, but I didn’t test it nor do I intend to fix any issues on it.

For those on hassio, you may have to restart 2-3 times before HA will load the dependencies. It doesn’t look like something we can control.

Features:

  • Add Alexa Guard mode support as an alarm_control_panel. Use ARM_AWAY to enable. (resolves #186)
  • Add HACS support. We will deprecate custom_updater shortly; please migrate. Thanks @xatr0z(resolves #201)

Fixes:

  • Remove async references (resolves #171)
  • Fix bug where announce did not work for multiple accounts (resolves #210)
  • Add further existing entity checks (resolves #180)
  • Add additional websocket reconnect logic (resolves #181)

Full changelog.

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

1 Like

Currently this is only available in the US right?

Yes, but it should only create the alarm_control_panel if it discovers the Alexa guard entity in your devices. Of course, I don’t have a non-US account so it’s possible Amazon has enabled the entity in the device list so we may try to load it even if it’s not functional.