alandtse / alexa_media_player

This is a custom component to allow control of Amazon Alexa devices in Home Assistant using the unofficial Alexa API.
Apache License 2.0
1.54k stars 291 forks source link

Region Mismatch and API Errors #2702

Open Pingfragger opened 5 days ago

Pingfragger commented 5 days ago

Describe the bug

The Alexa Media Player integration is experiencing issues with region mismatch and API errors. When using amazon.de, no devices are found, and API errors occur. Switching to amazon.com lists devices but they cannot be controlled. The integration fails to authenticate properly with amazon.de, resulting in no devices being listed and API errors. When switching to amazon.com, devices appear but cannot be controlled, with logs showing domain mismatch errors between amazon.com and amazon.de.

To Reproduce

The integration fails to authenticate properly with amazon.de, resulting in no devices being listed and API errors. When switching to amazon.com, devices appear but cannot be controlled, with logs showing domain mismatch errors between amazon.com and amazon.de.

Expected behavior

Devices should be discoverable and controllable using my Amazon region (amazon.de), without domain mismatch or authentication issues.

Screenshots

Login: Desktop Screenshot 2024 11 28 - 22 28 04 72

Errors after login (amazon.de) Desktop Screenshot 2024 11 28 - 22 31 20 89 Desktop Screenshot 2024 11 28 - 22 31 26 11 Screenshot_20241129_060352_Home Assistant

Errors after login (amazon.de) with Set async_timeout to 300 Desktop Screenshot 2024 11 28 - 22 59 13 66 Desktop Screenshot 2024 11 28 - 22 59 16 92

Error after login (amazon.com) Desktop Screenshot 2024 11 28 - 22 43 48 36

Result of login in amazon.de and amazon.com Desktop Screenshot 2024 11 28 - 22 45 20 59

System details

Home Assistant version: Core 2024.11.3 - Supervisor 2024.11.4 - Operating System 13.2 - Frontend 20241106.2 alexa_media version: 4.13.7, 4.13.8 and 5.0.0 tested alexapy version: 1.29.4 Is Amazon [2FA/2SV enabled]: Yes Amazon Domain: amazon.de

Debug Logs (alexa_media & alexapy)

home-assistant_2024-11-28T22-18-34.509Z.log

Additional context

What I already tried:

All of this did not work

It worked to integrate my wife's account (Amazon.de without 2FA). The devices appear there

Assumption: The problem might accur due to the number of devices in my account (Total about 110 devices - Echos and some sensors via the xiaomi skill). The devices cannot be deleted from the alexa app - > unknown error

Git-Vi commented 3 days ago

I have faced same issue:

danielbrunt57 commented 2 days ago

I have faced same issue:

  • Home assistant docker container - 2024.11.3
  • Alexa Media Player 5.0 (all recorders are removed from HA configuration file )
  • all entities are unavailable after the account sync. Amazon account from DE but it possible to add only with COM

Where are your devices registered? www.amazon.com or .de?

Mine originally were registered in Amazon.com as that is where I bought my first echo. Since then, I've moved them to amazon.ca, then back to .com and earlier this year back to .ca (all moves were to gain access to skills only available in .com or in .ca).

You have to use the domain where they are registered. Using another domain is pointless as it will fail to see them.

If they are in .de, use .de. If that fails at some point, that failure needs to be investigated and fixed. Trying to add the integration with another domain will only succeed in authenticating and initial setup with the cookie but will fail to see devices.