Echo Devices (Alexa) as Media Player - Testers Needed

Coming Soon

Could help but to share what I have so far.

14%20PM

9 Likes

sounds good, soon you get information in how to test what you developing lets us know
looking foward to make this work :slight_smile:

1 Like

Excellent work! Up and running and working swimmingly. Are you taking any requests? If so I’ll have ‘He’s a jolly good fellow’ please :grin:

I’m dying of anticipation. This is the answer for the masses! Keep up the good work!

1 Like

I’m running hassio but when I got to install the component it tries to install then loses connection. Any ideas?

I just tried to use curl via SSH directly on the vm, and “curl localhost” fails:
curl: (7) Failed to connect to localhost port 8091: Connection refused
127.0.0.1 fails too, using the normal hostname is working fine…

Ahh sorry - didn’t realise support for 64 bit system was available yet!

DrZzs just released a video featuring your component. Just so you know.

4 Likes

Is there any update on playing music from HA to alexa using this component?

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