Echo Devices (Alexa) as Media Player - Testers Needed

Hi, I have this issue. I’ve installed hassos 1.5 and when I try to install the api, I recive the following error in the log:

18-07-16 20:26:24 INFO (SyncWorker_10) [hassio.docker.interface] Pull image keatontaylor/aarch64-addon-alexa-api tag 0.5.
18-07-16 20:26:28 ERROR (SyncWorker_10) [hassio.docker.interface] Can’t install keatontaylor/aarch64-addon-alexa-api:0.5 -> 404 Client Error: Not Found (“pull access denied for keatontaylor/aarch64-addon-alexa-api, repository does not exist or may require ‘docker login’”).

Can anyone help me?

Thanks!

64-bit support is coming soon

Anybody got it works on hassbian?

@hugodelaroza - aarch64 is not supported. See this post - Echo Devices (Alexa) as Media Player - Testers Needed

working in the uk

had to disable 2 step authentication on amazon.co.uk

then everything works as it should

i can play music fine

can send tts fine

only thing ive found it cant do is send tts to the play everywhere group, it will play music fine but but send tts to it so i have to add my media players in seperately

{
“entity_id”: “media_player.kitchen, media_player.living_room”,
“message”: “home assistant set up test”
}

also can control volume great as a script:

alexavol10:
alias: Alexa Kitchen Vol 10
sequence:

  • data:
    entity_id: media_player.kitchen
    volume_level: 1
    service: media_player.volume_set
    alexavol7:
    alias: Alexa Kitchen Vol 7
    sequence:
  • data:
    entity_id: media_player.kitchen
    volume_level: 0.7
    service: media_player.volume_set

thanks for the great work

Big UPDATE!

The addon is no longer required! Once updating the alexa.py custom component you can safely uninstall and remove the hassio add-on. The alexa.py component can now login on its own to ge the proper session cookies.

Please ensure that when downloading the new alexa.py that you see 'VERSION: 0.6’

Things that you need to change:

New configuration has been added for the media_player component

media_player:
  - platform: alexa
    email: "your amazon email"
    password: "your amazon password"
    url: "amazon.com"

Replace [amazon.com] with your local amazon website. Note: this is slightly different than the url provided to the addon. It is just the base domain name, not any subdomains for the component.

When home assistant starts it will attempt to login with your credentials, and if a captcha is required it will generate a configurator component to request them from you.

14%20PM

If you fail to enter the captcha correctly it will reload the configurator to let you try again. (not the most elegant approach but the only good way to reload the URL for the captcha in the configurator component)

Once login succeeds the media player devices should be automatically loaded.

Current Limitations:

  • Does not store the cookies on disk (will ask for captcha each time HA is restarted)
  • No mechanism to ensure the session hasn’t expired (however the session cookies seem to look like they don’t expire for a really long time 20 years when I looked)

Coming Soon:

  • Using this method I am happy to say that I am pretty sure I can get 2FA authentication working.
  • Still need to implement play_media
12 Likes

Thank you for your work! Unfortunately I cannot get this to work on amazon.fr. I had to change username to email in the configuration, but then I get in an endless captcha loop. I was able to use the docker image properly before.

Ah, and I think I know what the issue might be. Could you test for me

Edit the following line in the alexa.py file:

'Accept-Language': 'en-US,en;q=0.5',

To:

'Accept-Language': 'en-FR,en;q=0.5',

I think I got that right for FR, but not 100% sure.

keep getting Invalid config for [media_player.alexa]: required key not provided @ data[‘email’]. Got None. (See ?, line ?). Please check the docs at Amazon Alexa - Home Assistant

my config is set up as:

media_player:

was working on 0.5 not working on 0.6

This has fixed it for me! Just a small correction in the configuration yaml

username: “[email protected]

I had to use

email: “[email protected]

Also for some reason the captcha did not work on the first try. But after 3 attempts it worked.
Might be me though :wink:

Thanks again and amazing work!!

2 Likes

@ut666 Thanks!

@gazzaman2k, sorry for the typo. username needs to be email

media_player:
  - platform: alexa
    email: "your amazon email"
    password: "your amazon password"
    url: "amazon.com"
1 Like

working now thankyou

The same thing seems to happen.

Hmm, I may need to create a test amazon.fr account to see what is going on

I’ve just set this up, and it works perfectly (not that the docker version didn’t also work btw). This is much more straight forward and really good work. I guess the next step/evolution is to get it into HA as a core component :slight_smile:

Really impressed with the work you’ve put into this!

Thank you.

@pembo thanks!

For those who have gotten the component only non-addon version working. What location are you in? Everyone in the US, or have others in other countries gotten it to work?

I’m in UK and it’s all working good other than my inability to read the captcha’s right :smiley:

Will do more testing tomorrow when the house is awake, but everything looks like it was before :slight_smile:

I’m in Brazil. Can’t get the captcha

image

US for me.

@SouzaaThales, hmmm that is odd that you’re not getting the captcha image. If the captcha wasn’t present it wouldn’t even give you the configure button at all. Does restarting home assistant make any difference?