Echo Devices (Alexa) as Media Player - Testers Needed

@ZombiEd, Ed,
I am not sure exactly which issue you have that was the same as mine; however, I can definitely say that mine are all resolved. Knock On Wood. I know it is difficult to follow a thread in this forum but chances are high that you would find the resolution, as I always post my solutions. There was one issue that was resolved by my submission of an official trouble ticket on GitHub. Here is that link just in case that is the issue you are experiencing.

If not, please contact me with your details & screenshots and I will do my best to get you to a resolution.

Anyone have any luck using echo devices in a speaker group like this? https://github.com/kalkih/mini-media-player#speaker-group-management

John,
Thanks for the reply and yes I was referring to the problem you had with the Alexa media player. I’m getting the same error msg apparently trying for about a minute before timing out. At first I thought something was wrong with the 2fa and turned it off at amazon. Obviously it had no effect. I suspect that it is an SSL cert issue but unable to verify as I don’t seem to be getting anything in the logs except when I try using the local url instead of external. It fails immediately however, with an invalid url so not much help. I know both urls work so without any logs no clue what the problem is.

Like you I think this integration is what really makes HA work as a smart home.

Again, trying to figure what process(es) you have already done.

  1. Did you remove the failing integration?
  2. Did you remove the lines from configuration.yaml? (A previous update required you to remove them.)
  3. restart HA without errors you mention?
  4. to start the install . Are you in Devices & Services, and it is not there until you search for it and start install?
  5. are us using the 2FA seed key from the Amazon site? (52 Characters).
  6. have you been following you error log to determine why it is timing out?

How did you…

  1. Yes; added and removed integration twice, no change
  2. This was a clean install of HACS and Alexa media controller so nothing in configuration.yaml to remove. (I had removed HACS and all custom integrations 2+ years ago when I had decided to strip HA down to basics)
  3. Yes. I just get the warning of an untested integration.
  4. Had no problem finding Alexa media player in Devices & Services
  5. Yes 2fa is active both for HA and Amazon
  6. Check logs for both HA core and Supervisor only think that shows up in HA Core is

2022-07-18 14:51:23 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.7.38: Connection timed out for hub 8829300
2022-07-18 15:21:29 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2022-07-18 15:42:04 ERROR (MainThread) [frontend.js.latest.202207071] :0:0 ResizeObserver loop completed with undelivered notifications.
2022-07-18 15:43:23 ERROR (MainThread) [frontend.js.latest.202207071] :0:0 ResizeObserver loop completed with undelivered notifications.
2022-07-18 16:17:39 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session

These are new and don’t appear to be Alexa media player related.

Running on a Raspberry Pi 4 (32-bit)
HA core: 2022.7.5
HA Supervisor: 2022.07.0
HA OS: 8.2
2FA enabled: Yes
HACS: 1.26.2
Alexa Media Player: 4.0.3

I’m assuming with the current version of Alexa media player there isn’t a need for configuration.yaml entries as it will soon be deprecated.

I don’t get a CAPTCHA challenge.

I don’t get a text from Amazon or verification telling me there was an attempt to logon from a new source. Also how do I verify OTP on Amazon page

I’ve been reading through all the closed tickets and have not yet to find any with a fix that works for me.

Have this still in most of the restarts

2022-07-19 08:12:57 ERROR (MainThread) [homeassistant.components.switch] Error while setting up alexa_media platform for switch
File "/config/custom_components/alexa_media/switch.py", line 44, in async_setup_platform
2022-07-19 08:12:57 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up alexa_media platform for sensor
File "/config/custom_components/alexa_media/sensor.py", line 59, in async_setup_platform
2022-07-19 08:12:57 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up alexa_media platform for alarm_control_panel
File "/config/custom_components/alexa_media/alarm_control_panel.py", line 53, in async_setup_platform
2022-07-19 08:12:57 ERROR (MainThread) [homeassistant.components.light] Error while setting up alexa_media platform for light
File "/config/custom_components/alexa_media/light.py", line 78, in async_setup_platform

Any idea on this?

Sorry if I appear skeptical, but you did not indicate is you have the 52 character seed for amazon 2FP. one is for your traditional log-in using an external verification app and the 2nd is for Home assistant to generate its own response code.
Please verify you have this by logging into you Amazon account… Navigate:
your account, login & security, Two-Step Verification (2SV) Settings


If you have two, did you save the 52 character seed code for reinstallation?
The only other thing i can think of is the URL to access Home Assistant. It must be https://
I am using duckdns. You?

Yes, I did copy the code and pasted it in the appropriate field. Amazon doesn’t show a 2 yet because the submit to install Alexa media player does not generate the 6-digit code to complete activation.

Also I use duckdns as well and have verified https://

2022-07-19 11:15:42 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating new login
2022-07-19 11:15:42 DEBUG (MainThread) [custom_components.alexa_media.helpers] r******c@g*******m: Returning uuid {'uuid': '******************************************', 'index': 0}
2022-07-19 11:15:42 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for C************************************************4JQ
2022-07-19 11:15:42 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP ******
2022-07-19 11:15:42 DEBUG (MainThread) [alexapy.alexalogin] Login created for r******c@g*******m - amazon.com
2022-07-19 11:17:55 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Unable to connect to provided Home Assistant url: https://****.duckdns.org:8123

I have cut and pasted the HA url directly into a browser and it works.

I don’t get the captcha screen pop up so I’m now thinking since I don’t see that and because I don’t respond the connection fails. Just verified it isn’t a popup issues as I disabled my popup blocker.

Just tried falling back to 3.11; didn’t seem to change a thing. I still don’t get the CAPTCHA screen which probably means the logon attempt times out which would explain why the connection fails.

Are you positive the port is 8123 for your url? Https is typically port 22 and does not need to be specified unless you have changed it. The HA server cannot connect to the URL you are providing.

No, not really. I still have these errors from time to time I believe mostly when I change things on the Alexa side, adding a device i. e. As it has no further influence on functionality, I ignored them.

Yes, I’ve been using port 8123 for a number of years now to access HA externally. It was the default when I first installed HA using DuckDNS for external access.

Okay, now I believe I know where you are at and can proceed with the same page :slight_smile:
I am not sure if the seed code you copied is good from amazon since it was not verified. Recommend having a tab open with a fresh seed code. Secondly, as alandis recommended, try it without specifying a port. Also, try it using your local address in that field. the only other variable I can think of at this time is the browser. If I remember correctly, I had to install Google Chrome.

When I grabbed the seed from Amazon, I left the tab open on the page that has the QR code and the empty space for the OTP to be entered. In fact, amazon won’t let you close the page until you enter a valid OTP.

I have Chrome, Firefox, and Edge. I’ve tried it with HA in both Chrome and Firefox but not Edge. I was going to try it from Edge later today

As far as using this with out port 8123. Tried it without, install failed. Tried the Local ip both with and without port 8123, immediately fails as soon as I hit the submit button.

Is there a problem specifically related to port 8123? This is how my HA was originally configured since 2016 and has worked without issue.

It’s not a browser issue. It’s the HA server cannot access the url you are providing. The component is checking that the url provided is valid. If your HA url is inaccessible to the component, it will provide this error.

I didn’t think this was a browser issue. What is stumping me is that I don’t seem to be getting anything to work with in the logs. I thought it might be a firewall issue since HA and my IoT devices are on a separate subnet from the rest of my computers. So using my phone I got on my IoT subnet and tried it again. same results. But what I saw interesting is that in the logs

2022-07-20 13:25:42 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Creating new login
2022-07-20 13:25:42 DEBUG (MainThread) [custom_components.alexa_media.helpers] r******c@g*******m: Returning uuid {'uuid': '07537da4ec0e2c01281190c4e748c1b3', 'index': 0}
2022-07-20 13:25:42 DEBUG (MainThread) [alexapy.alexalogin] Creating TOTP for C************************************************4JQ
2022-07-20 13:25:42 DEBUG (MainThread) [alexapy.alexalogin] Generating OTP 617015

It gets to generating the OTP almost immediately and but the submit continues to spin for quite some time before I get the rest in the log.

2022-07-20 13:25:42 DEBUG (MainThread) [alexapy.alexalogin] Login created for [email protected] - amazon.com
2022-07-20 13:28:27 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Unable to connect to provided Home Assistant url: https://192.168.7.68:8123
2022-07-20 13:28:27 DEBUG (MainThread) [custom_components.alexa_media.config_flow] Using existing login

This is all I get, it just says the url is not accessible. BTW: it does the same regardless how I specify the url.
I’ve been looking through all your closed tickets and yes I see some with a common symptom, but as I go through what they did to fix their problem, it doesn’t fix mine. I’m pretty good a debugging, but quite frankly, the log isn’t giving me anything to work with other than what I all ready know it can’t connect to my url. You would think that if there is an error, I would see that though not sure what to look for. At 100+ hours I’m not just trying to dump this on someone else; just a friendly nod in directions I need to check.

It generates the TOTP to test that it’s valid. That’s not the issue.

The code is literally doing a get request to the URL provided. There’s nothing to debug other than your network config. You could literally do the same test using curl or some other command line script in your HA instance.

Please note https://192.168.7.68:8123 will likely fail because the SSL cert is invalid unless you specifically setup your local IP with your HA cert. Have you tried the http url like http://192.168.7.68:8123?

Thanks. Strange I never got a cert verification error and would not have thougt to use curl.

for http://192… I get a curl (52) empty reply from server. And for https://192… curl: (60) SSL: no alternative certificate subjectname matches target host name

Because I use DuckDNS, my cert is for xxxx.duckdns.org. I don’t know much about certificates so I will need to do some reading to determine a course of action.

So I’m reading 1648 at the moment.

As a note, I made a release that lets you skip the warning if you’re positive the URL is correct. Please note skipped warnings will not get any login support though.

You keep suggesting I don’t have the correct url even though I’ve been using them for years. I think I know what is going on. I don’t have a typical home set up. I have essentially two networks for my equipment:

  • a Home network (subnet) for most of the household personal computers, tablets, and smartphones

  • and an IoT network (subnet with wireless vlan) for IoT devices and HA (though they can be accessed via Home network)

Using firewall rules, the Home network is able to initiate connects / communicate with devices on the IoT network. Devices on the IoT network are NOT able to initiate connections / independently communicate to the Home network. This is one of my layers of security.

When I tested accessing HA from my iPhone that I put on the IoT network I got the same error I’m getting from Amp. This is likely by design of my firewall rules and since I set this up quite some time ago, need to review my set up and see if this is so and what my options are.

I want to state, I’ve had this configuration up and running for years and never had a problem until installing the Alexa media player.

The reason I can’t seem to use the local IP address is the conflict with the cert. Since I only have a basic knowledge of certs, I’m looking to see if the IP address can be added to my existing cert as an alternative subject name.

I’m hoping there is a way to fix the cert to resolve the problem.

I’m not suggesting anything. I’m telling you what the test is doing.

As we use a mitm proxy to intercept login credentials, the user has to be able to reach the HA url to access the proxy. To avoid issues where someone has misconfigured their HA by having a bad cert or bad url listed in HA, we check that the external url is valid before enabling the proxy. As the component lives on the HA server, it has to do that check from the server itself. So if you have some strange situation where the HA server cannot access itself through the URL you provide during setup, the test fails.

As mentioned, for people in this weird situation, I’m letting you bypass it with the release I just did. I’m just not wasting time anymore with people with special server configurations since the network configuration has nothing to do with the code in the component.

1 Like