Echo Devices (Alexa) as Media Player - Testers Needed

I’ve just tried the routine again, and now it’s working

{
  "entity_id": "media_player.echo_2",
  "media_content_id": "Apri tenda sala",
  "media_content_type": "routine"
}

This is really interesting stuff!

Thanks @alandtse

you call this with media_player.play_media right?

Yes, media_player.play_media.

In Italian language.

ok doesn’t work for me

Do you have SSL active?
With SSL it doesn’t work for me, only HTTP.

yes I have ssl active. interessting… @alandtse

This is an issue I’m having also with tts.google_say

See my request and the answer I’ve got.

Yes, that certainly has worked for a month or so, I have it fire every morning (well, every work morning).

Just tried the below (based on the routine) and it worked…for now…so I’ll go with that.

{
“entity_id”: “media_player.bedroom”,
“media_content_id”: “e._s._p._n. radio”,
“media_content_type”: “TUNEIN”
}

Turning off ssl is no option for me.
But why does sequence and tts work and routines don’t?

I really don’t know!

Also with Google Home, with SSL if I ask to play a radio, it works, TTS doesn’t.

As it was said on the other thread, if you need SSL on the outside network you can have NGINX while on the inside no SSL.

there is a difference.
google home expected port 80 from the beginning
amazon doesnt.

and nginx wouldnt bring anything with this, because you are communicating with amazon servers and not locally.

So now I’m more confused.

I have NGINX installed, but as far as I understood is not needed since I access from outside to my internal network only via VPN.

I don’t have any open port on my router, so how Google/Alexa stuff works within HA?

ha sends the commands (whatever kind) to the amazon server.
amazon thinks it coming from the alexa app or from 1 of your alexa devices and sends it to the device that needs it.

how amazon communicates with an alexa device is probably with an opened http gate. (a webpage on the device stays open for input)

Here are a couple of data points from my testing of 1.1.0 using TUNEIN where “media_content_id” is:

  1. “BBC one” This works.
  2. “NPR” This has always worked but no longer…Alexa says it “can not play by artist on Tune-in”
  3. “N P R” sorta works but picks the incorrect media channel.
  4. “n. p. r.” now works properly. I found out by verbally asking Alexa to play N P R and checking history.

thats just like real life. say something to anybody and check what they did understand from your words :wink:

I’ve tried getting this to work on my non hass.io Home Assistant (Running on a QNAP in container station). Just to confirm before my hair gets even more grey, this is hass.io-only?

Delays are probably system dependent so I think you’ll have to check. Last_alexa relies on contacting Amazon’s servers to get the latest history, so internet connection issues may factor in.

I wonder if Amazon is tweaking the algorithm given the fact others have reported it as inconsistent too.

Thanks, I added this to the wiki.

No, it should run on any HA with custom_components. Don’t rely on the early parts of this 2K post threads. A lot of the older information is bad. Consult the Wiki.

Hey, I installed the latest version and still not working, when I select Sms or email I get no confirmation,

2019-03-02 12:58:36 DEBUG (MainThread) [alexapy.alexalogin] Performing second login to: Amazon.fr
2019-03-02 12:58:36 DEBUG (MainThread) [alexapy.alexalogin] Another login requested to: Amazon.fr
2019-03-02 12:58:36 DEBUG (MainThread) [custom_components.alexa_media] Creating configurator to start new login attempt
2019-03-02 12:59:25 DEBUG (MainThread) [custom_components.alexa_media] Status: {‘login_failed’: True} got captcha: None securitycode: None Claimsoption: None VerificationCode: None
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] No valid cookies for log in; using credentials
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Loaded last request to Amazon.fr
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Preparing post to Amazon.fr Captcha: None SecurityCode: None Claimsoption: None VerificationCode: None
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Cookies: <RequestsCookieJar[<Cookie session-id=260-2387967-2716956 for .amazon.fr/>, <Cookie session-id-time=2182245950l for .amazon.fr/>, <Cookie session-token=“fjKsT3kQ9egzVJqaajfSgssWktAfXiJtlUC3RYiA3Oay02yaVPqRh5tUXO5yWEkgVX5eHpV4Ll9mQluDsDfeIhk0/l7LM8OegBl6uOLgyXtN/2h54t9XzRQsudOMuVpeAeWmdiYFYYfJ3SoCn7WAQB8gJSeyGIV5AayOFzJZAoOJACwldM97YDQvdlj+HmM4/qt8X2NX6z5Rp7pfGTi/uw==” for .amazon.fr/>, <Cookie ubid-acbfr=257-5558584-9265909 for .amazon.fr/>]>
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Submit Form Data: {‘clientContext’: ‘257-5558584-9265909’, ‘showRmrMe’: ‘1’, ‘use_global_authentication’: ‘false’, ‘openid.return_to’: ‘Connexion Amazon’, ‘openid.identity’: ‘http://specs.openid.net/auth/2.0/identifier_select’, ‘openid.assoc_handle’: ‘amzn_dp_project_dee_fr’, ‘openid.mode’: ‘checkid_setup’, ‘pageId’: ‘amzn_dp_project_dee_fr’, ‘openid.claimed_id’: ‘http://specs.openid.net/auth/2.0/identifier_select’, ‘openid.ns’: ‘http://specs.openid.net/auth/2.0’, ‘verifyToken’: ‘s|c5247bbf-3321-32ed-afac-e8b62251940d’, ‘option’: b’sms’}
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Header: {‘User-Agent’: ‘Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36’, ‘Accept’: ‘text/html,application/xhtml+xml, application/xml;q=0.9,/;q=0.8’, ‘Accept-Language’: ‘*’, ‘Referer’: ‘Amazon.fr’, ‘Content-Type’: ‘application/x-www-form-urlencoded; charset=utf-8’}
2019-03-02 12:59:26 DEBUG (MainThread) [alexapy.alexalogin] Performing second login to: Amazon.fr
2019-03-02 12:59:26 DEBUG (MainThread) [alexapy.alexalogin] Another login requested to: Amazon.fr
2019-03-02 12:59:26 DEBUG (MainThread) [custom_components.alexa_media] Creating configurator to start new login attempt

Thanks. I’ve tried following the wiki but it seems I am noobing out on something. I get
“2019-03-02 13:19:31 ERROR (MainThread) [homeassistant.loader] Unable to find platform alexa”

I created a folder under config called custom_components/alexa_media where I have downloaded the newest versions of init.py, const.py and media_player.py. In the configuration.yaml I have added

media_player:
    platform: alexa
    email: !secret aws_email
    password: !secret aws_pwd
    url: amazon.com

still no luck :frowning:

Read the posts of the last few days, you will find this issue a few times.
Or read the wiki of the component.