core icon indicating copy to clipboard operation
core copied to clipboard

Error: No devices or entities Failed setup, will retry: ‘devicePreferences’

Open gherbstman opened this issue 7 months ago • 13 comments

The problem

After installing, Login to Amazon was successful. Directly after I received a message: No devices or entities Failed setup, will retry: ‘devicePreferences’

I have not been able to get this to find any devices. I have removed it and re added it. Restarted HA. Running HA Green. with latest updates on all components.

From the logs I have this information:

` Logger: homeassistant.components.alexa_devices Source: helpers/update_coordinator.py:382 integration: Alexa Devices (documentation, issues) First occurred: 06:27:49 (56 occurrences) Last logged: 07:33:32

Unexpected error fetching [Amazon Account Name] 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 574, in get_devices_data for data in json_data[key]: ~~~~~~~~~^^^^^ KeyError: 'devicePreferences' `

What version of Home Assistant Core has the issue?

2025.6.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

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?

Logger: homeassistant.components.alexa_devices
Source: helpers/update_coordinator.py:382
integration: Alexa Devices (documentation, issues)
First occurred: 06:27:49 (56 occurrences)
Last logged: 07:33:32

Unexpected error fetching [Amazon Account Name] 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 574, in get_devices_data
    for data in json_data[key]:
                ~~~~~~~~~^^^^^
KeyError: 'devicePreferences'

Additional information

No response

gherbstman avatar Jun 12 '25 13:06 gherbstman

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 12 '25 13:06 home-assistant[bot]

Hopefully some more useful information.

We have a lot of Alexa devices on our network probably around twenty. I ran a debug and there is some information I don't want to post as it has data about my devices but here are some snippets that may be useful.

This call Appears to be successful and returned a lot of data that looks valid: 2025-06-12 09:06:05.909 DEBUG (MainThread) [aioamazondevices] Creating HTTP session (aiohttp) 2025-06-12 09:06:05.910 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/devices-v2/device with payload None [json=False] 2025-06-12 09:06:06.201 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {'csrf': '-2016431233'} 2025-06-12 09:06:06.201 DEBUG (MainThread) [aioamazondevices] Response 200 for url https://alexa.amazon.com/api/devices-v2/device with content type: application/json 2025-06-12 09:06:06.203 DEBUG (MainThread) [aioamazondevices] Response URL: https://alexa.amazon.com/api/devices-v2/device 2025-06-12 09:06:06.203 DEBUG (MainThread) [aioamazondevices] Response code: |200| Same with this set of calls: 2025-06-12 09:06:06.209 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/dnd/device-status-list with payload None [json=False] 2025-06-12 09:06:06.416 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {} 2025-06-12 09:06:06.416 DEBUG (MainThread) [aioamazondevices] Response 200 for url https://alexa.amazon.com/api/dnd/device-status-list with content type: application/json 2025-06-12 09:06:06.417 DEBUG (MainThread) [aioamazondevices] Response URL: https://alexa.amazon.com/api/dnd/device-status-list 2025-06-12 09:06:06.417 DEBUG (MainThread) [aioamazondevices] Response code: |200|

This however appears to have had a failure:

2025-06-12 09:06:06.418 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/device-preferences with payload None [json=False] 2025-06-12 09:06:06.617 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {} 2025-06-12 09:06:06.617 DEBUG (MainThread) [aioamazondevices] Response 500 for url https://alexa.amazon.com/api/device-preferences with content type: application/json 2025-06-12 09:06:06.618 DEBUG (MainThread) [aioamazondevices] Response URL: https://alexa.amazon.com/api/device-preferences 2025-06-12 09:06:06.619 DEBUG (MainThread) [aioamazondevices] Response code: |500| 2025-06-12 09:06:06.619 DEBUG (MainThread) [aioamazondevices] Response data: |{"message":null}| 2025-06-12 09:06:06.619 DEBUG (MainThread) [aioamazondevices] JSON data: |{'message': None}| 2025-06-12 09:06:06.619 ERROR (MainThread) [homeassistant.components.alexa_devices] Unexpected error fetching [Amazon Account] 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 574, in get_devices_data for data in json_data[key]: ~~~~~~~~~^^^^^ KeyError: 'devicePreferences'

gherbstman avatar Jun 12 '25 13:06 gherbstman

`2025-06-12 09:06:06.418 DEBUG (MainThread) [aioamazondevices] GET request: https://alexa.amazon.com/api/device-preferences with payload None [json=False] 2025-06-12 09:06:06.617 DEBUG (MainThread) [aioamazondevices] Cookies from headers: {} 2025-06-12 09:06:06.617 DEBUG (MainThread) [aioamazondevices] Response 500 for url https://alexa.amazon.com/api/device-preferences with content type: application/json

Unfortunately you got a 500 error reply: Internal Server Error.

Not much we can do, if not trapping and handling the error.

chemelli74 avatar Jun 12 '25 14:06 chemelli74

Is this 500 error an Amazon back-end issue, or an issue with the request being sent to Amazon?

gherbstman avatar Jun 12 '25 15:06 gherbstman

Is this 500 error an Amazon back-end issue, or an issue with the request being sent to Amazon?

The first. Maybe due to a high number of requests from your account.

chemelli74 avatar Jun 12 '25 16:06 chemelli74

Thanks, I will see what I can find on my end.

gherbstman avatar Jun 12 '25 16:06 gherbstman

Having the same issue here as well. I have 5 devices on my network. The integration logs in but just get an error. Says "No devices or entities. Failed setup, will retry: 'G07131161232...'". Integration doesn't appear to work.

kadeschs avatar Jun 14 '25 18:06 kadeschs

I am getting the same error:

Image

I also get the "Needs attention" message:

Image

My system Log states:

`Logger: homeassistant.components.alexa_devices Source: helpers/update_coordinator.py:382 integration: Alexa Devices (documentation, issues) First occurred: 1:17:21 PM (15 occurrences) Last logged: 1:28:21 PM

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: 'G3A0PA0102762DM4'`

Holydoc avatar Jun 14 '25 18:06 Holydoc

Having the same issue here as well. I have 5 devices on my network. The integration logs in but just get an error. Says "No devices or entities. Failed setup, will retry: 'G07131161232...'". Integration doesn't appear to work.

You don't have the same log, so you should have opened a new issue. Anyway your problem is already fixed via #146828

chemelli74 avatar Jun 14 '25 22:06 chemelli74

I am getting the same error:

self._devices[serial_number] |= {NODE_IDENTIFIER: identifier}
~~~~~~~~~~~~~^^^^^^^^^^^^^^^

KeyError: 'G3A0PA0102762DM4'`

Same as above

chemelli74 avatar Jun 14 '25 22:06 chemelli74

Anyway your problem is already fixed via https://github.com/home-assistant/core/pull/146828

Not really. It now just says "Invalid authentication" instead. I'm using Google Authenticator OTP. I put email address, password, and OTP number. Not sure what more to do?

kadeschs avatar Jun 15 '25 01:06 kadeschs

Anyway your problem is already fixed via https://github.com/home-assistant/core/pull/146828

Not really. It now just says "Invalid authentication" instead. I'm using Google Authenticator OTP. I put email address, password, and OTP number. Not sure what more to do?

New problem? Then opens new issue with details info and debug log

chemelli74 avatar Jun 15 '25 08:06 chemelli74

New problem? Then opens new issue with details info and debug log

Possibly. I have opened a new issue and it appears others are experiencing similar problems.

kadeschs avatar Jun 15 '25 16:06 kadeschs

Same me 🫣. Alexa Germany.

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 513, in _get_devices_ids network_detail = orjson.loads(json_data["networkDetail"]) ~~~~~~~~~^^^^^^^^^^^^^^^^^ KeyError: 'networkDetail'

Helge1308 avatar Jun 17 '25 17:06 Helge1308