Echo Devices (Alexa) as Media Player - Testers Needed

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