core icon indicating copy to clipboard operation
core copied to clipboard

Amazon Alexa Devices - No Devices after Bump aioamazondevices to 3.1.3

Open kadeschs opened this issue 10 months ago • 8 comments

The problem

Bump aioamazondevices to 3.1.3 #146828 still returns this: No devices or entities Failed setup, will retry: 'G071311612320037'

Unexpected error fetching [email protected] data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 382, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/alexa_devices/coordinator.py", line 54, in _async_update_data return await self.api.get_devices_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aioamazondevices/api.py", line 700, in get_devices_data entity_ids_list = await self._get_devices_ids() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aioamazondevices/api.py", line 541, in _get_devices_ids self._devices[serial_number] |= {NODE_IDENTIFIER: identifier} ~~~~~~~~~~~~~^^^^^^^^^^^^^^^ KeyError: 'G071311612320037'

2025-06-14 22:23:50.376 DEBUG (MainThread) [aioamazondevices] Found previous login data, loading serial number 2025-06-14 22:23:50.377 DEBUG (MainThread) [aioamazondevices] Logging-in for [email protected] with stored data 2025-06-14 22:23:50.377 DEBUG (MainThread) [aioamazondevices] Creating HTTP session (aiohttp) 2025-06-14 22:23:50.377 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/devices-v2/device with payload None [json=False] 2025-06-14 22:23:50.626 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {'csrf': '1145281417'} 2025-06-14 22:23:50.626 DEBUG (MainThread) [aioamazondevices] Response 200 for url https://alexa.amazon.com/api/devices-v2/device with content type: application/json 2025-06-14 22:23:50.627 DEBUG (MainThread) [aioamazondevices] Response URL: https://alexa.amazon.com/api/devices-v2/device 2025-06-14 22:23:50.628 DEBUG (MainThread) [aioamazondevices] Response code: |200| 2025-06-14 22:23:50.629 DEBUG (MainThread) [aioamazondevices] Response data: |{"devices":[{"accountName":"xxxxx Echo Dot" ... 2025-06-14 23:08:08.386 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/phoenix with payload None [json=False] 2025-06-14 23:08:08.583 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {} 2025-06-14 23:08:08.583 DEBUG (MainThread) [aioamazondevices] Response 200 for url https://alexa.amazon.com/api/phoenix with content type: application/json 2025-06-14 23:08:08.596 DEBUG (MainThread) [homeassistant.components.alexa_devices] Finished fetching [email protected] data in 1.374 seconds (success: False)

What version of Home Assistant Core has the issue?

2025.6.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Amazon Alexa Devices

Link to integration documentation on our website

https://www.home-assistant.io/integrations/alexa_devices

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

G071311612320037 is a serial number that does not match any of my current devices listed in my Alexa account.

kadeschs avatar Jun 15 '25 03:06 kadeschs

Hey there @chemelli74, mind taking a look at this issue as it has been labeled with an integration (alexa_devices) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of alexa_devices can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign alexa_devices Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


alexa_devices documentation alexa_devices source (message by IssueLinks)

home-assistant[bot] avatar Jun 15 '25 03:06 home-assistant[bot]

🔍 Potential duplicate detection

I've analyzed similar issues and found the following potential duplicates:

What to do next:

  1. Please review these issues to see if they match your issue
  2. If you find an existing issue that covers your problem:
    • Consider closing this issue
    • Add your findings or 👍 on the existing issue instead
  3. If your issue is different or adds new aspects, please clarify how it differs

This helps keep our issues organized and ensures similar issues are consolidated for better visibility.

This message was generated automatically by our duplicate detection system.

github-actions[bot] avatar Jun 15 '25 03:06 github-actions[bot]

I’m sorry, just curious. Did you patch it yourself to try? Cause the bump to 3.1.3 won’t occur until the next core upgrade (2025.6.2?) to my understanding, which if all goes according to plan, would be Friday.

mmstano avatar Jun 15 '25 05:06 mmstano

I’m sorry, just curious. Did you patch it yourself to try? Cause the bump to 3.1.3 won’t occur until the next core upgrade (2025.6.2?) to my understanding, which if all goes according to plan, would be Friday.

Yes, I did. I ran pip install --upgrade aioamazondevices to go from 3.1.2 to 3.1.3 as I'm not wanting to wait around for the next core upgrade to get this integration working correctly.

kadeschs avatar Jun 15 '25 14:06 kadeschs

Well darn lol, I was looking forward to it. It was my issue that was closed in an effort to fix it. Are you using HAOS? Did you have to SSH into the home assistant container to run the pip command? I've always been patient and waited for the core upgrade, but now I want to give it a go and see if it solves my device issue. Perhaps the error is device specific.

mmstano avatar Jun 15 '25 14:06 mmstano

Well darn lol, I was looking forward to it. It was my issue that was closed in an effort to fix it. Are you using HAOS? Did you have to SSH into the home assistant container to run the pip command? I've always been patient and waited for the core upgrade, but now I want to give it a go and see if it solves my device issue. Perhaps the error is device specific.

I'm using HA Container. Yeah, you have to SSH inside the container and run pip to update the files. docker exec -it home-assistant bash

kadeschs avatar Jun 15 '25 15:06 kadeschs

Well darn lol, I was looking forward to it. It was my issue that was closed in an effort to fix it. Are you using HAOS? Did you have to SSH into the home assistant container to run the pip command? I've always been patient and waited for the core upgrade, but now I want to give it a go and see if it solves my device issue. Perhaps the error is device specific.

I'm using HA Container. Yeah, you have to SSH inside the container and run pip to update the files. docker exec -it home-assistant bash

Yea... just tried it and no dice. I still get my original error, too. I did test the python library and sent the requested files to the maintainer in discord.

mmstano avatar Jun 15 '25 15:06 mmstano

I'm using HA Container. Yeah, you have to SSH inside the container and run pip to update the files. docker exec -it home-assistant bash

@kadeschs You made anything else ?

I have tried removing the alexa devices configuration, did the pip install --upgrade but still using older version that was probably on memory. If I do the upgrade as soon the container starts or I do the HA restart action command it reverts back the files to HA original version (I have checked the aioamazondevices files installed and they change).

ivanfmartinez avatar Jun 15 '25 16:06 ivanfmartinez

I have tried removing the alexa devices configuration, did the pip install --upgrade but still using older version that was probably on memory. If I do the upgrade as soon the container starts or I do the HA restart action command it reverts back the files to HA original version (I have checked the aioamazondevices files installed and they change).

Alexa Devices integration is explicitly requiring aioamazondevices==3.1.2, which is why Home Assistant keeps reverting to that version. Use pip again to get 3.1.6. To override this version lock, edit the requirement line in alexa_devices manifest.json to "requirements": ["aioamazondevices==3.1.6"] and restart HA.

Can confirm that 3.1.6 appears to be working. No errors and creates devices and entities.

kadeschs avatar Jun 16 '25 14:06 kadeschs

I tried, but I'm using Home Assistant OS (which I understand is fickle when trying to do patches) and I'm getting hung up with an OTP error. I SSH'd into the HA container using Advanced SSH add-on, edited the requirement to 3.1.6 and upgraded aioamazondevices, but still no dice. Glad to hear you've got it working. I'll just have to wait for the upgrade to core.

error I'm getting -

`Logger: aiohttp.server Source: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:481 First occurred: 11:25:51 AM (7 occurrences) Last logged: 11:35:40 AM

Error handling request from 172.30.33.8 Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 83, in with_admin return await func(self, request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 227, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ flow, cur_step["step_id"], user_input ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 487, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/alexa_devices/config_flow.py", line 34, in async_step_user data = await client.login_mode_interactive(user_input[CONF_CODE]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aioamazondevices/api.py", line 639, in login_mode_interactive authcode = self._extract_code_from_url(login_resp.url) File "/usr/local/lib/python3.13/site-packages/aioamazondevices/api.py", line 266, in _extract_code_from_url return parsed_url["openid.oa2.authorization_code"][0] ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'openid.oa2.authorization_code'`

mmstano avatar Jun 16 '25 15:06 mmstano

I have tried removing the alexa devices configuration, did the pip install --upgrade but still using older version that was probably on memory. If I do the upgrade as soon the container starts or I do the HA restart action command it reverts back the files to HA original version (I have checked the aioamazondevices files installed and they change).

Alexa Devices integration is explicitly requiring aioamazondevices==3.1.2, which is why Home Assistant keeps reverting to that version. Use pip again to get 3.1.6. To override this version lock, edit the requirement line in alexa_devices manifest.json to "requirements": ["aioamazondevices==3.1.6"] and restart HA.

Can confirm that 3.1.6 appears to be working. No errors and creates devices and entities.

I have tried changing only manifest.json and it returned to original version. Only worked when I changed also the requiremests_all.txt

ivanfmartinez avatar Jun 16 '25 16:06 ivanfmartinez

Can confirm that 3.1.6 appears to be working. No errors and creates devices and entities.

3.1.6 still have problems with new logins when the server returns 404.

this https://github.com/chemelli74/aioamazondevices/pull/281 or something similar has to be merged to help on the login procedure

ivanfmartinez avatar Jun 16 '25 16:06 ivanfmartinez