Home Assistant Community

Echo Devices (Alexa) as Media Player - Testers Needed

alexa
Tags: #<Tag:0x00007fcf4ca86d80>
#2087

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

#2088

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.

#2089

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.

#2090

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?

#2091

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)

#2092

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.
#2093

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

#2094

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?

#2095

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.

#2096

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: https://www.amazon.fr/ap/signin
2019-03-02 12:58:36 DEBUG (MainThread) [alexapy.alexalogin] Another login requested to: https://www.amazon.fr/ap/signin
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 https://www.amazon.fr/ap/signin
2019-03-02 12:59:25 DEBUG (MainThread) [alexapy.alexalogin] Preparing post to https://www.amazon.fr/ap/signin 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’: ‘https://alexa.amazon.fr/api/devices-v2/device’, ‘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’: ‘https://www.amazon.fr/ap/signin’, ‘Content-Type’: ‘application/x-www-form-urlencoded; charset=utf-8’}
2019-03-02 12:59:26 DEBUG (MainThread) [alexapy.alexalogin] Performing second login to: https://www.amazon.fr/ap/signin
2019-03-02 12:59:26 DEBUG (MainThread) [alexapy.alexalogin] Another login requested to: https://www.amazon.fr/ap/signin
2019-03-02 12:59:26 DEBUG (MainThread) [custom_components.alexa_media] Creating configurator to start new login attempt

#2097

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:

#2098

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

#2099

Yeah I’ve tried reading the thread and the wiki but I can’t figure it out. Guess I’ll check back in a while.

#2100

Your configuration is wrong.

See

#2101

you are using the “old” way of configuring the component.

Once you have all of the files in the correct locations then add this to your configuration.yaml file (substituting your details):

alexa_media:
  accounts:
    - email: !secret amazon_email
      password: !secret amazon_pass
      url: amazon.com

and you also need to remove the config entry you posted above.

restart and it hopefully will work.

#2102

Thanks, already tried that though. HA won’t start if I use the config you posted:

#2103

Ok, I’m pretty sure your problem is that you copied the code from the github incorrectly.

When you go to the github code page for each file you will find a “raw” button at the top of the code box. Click it. It will then open another window with just the code in it. Copy all of that content and put it into your file and then save it. Do the same for the other files.

restart HA with the correct config code above.

#2104

Sweet, thanks! Away from the computer now but I’ll try when I’m back tomorrow. Again thanks alot :smile:

#2105

just updated mine. getting no errors however my TTS is not playing on my echo devices. it was working fine until this new version.

#2106

I’m pretty sure you’re not supposed to add the word “Alexa,” to the routine.