home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.34k stars 29.88k forks source link

Unable to add Philips Hue Bridge #125546

Open skenmy opened 1 week ago

skenmy commented 1 week ago

The problem

An error appears in the logs after adding a Hue Bridge, and the bridge is not usable within HA.

What version of Home Assistant Core has the issue?

core-2024.9.1

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

Philips Hue

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.hue.bridge
Source: components/hue/bridge.py:78
integration: Philips Hue (documentation, issues)
First occurred: 22:43:17 (2 occurrences)
Last logged: 22:48:11

Unknown error connecting to Hue bridge
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 78, in async_initialize_bridge
    await self.api.initialize()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 108, in initialize
    await self.fetch_full_state()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 252, in fetch_full_state
    await asyncio.gather(
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 80, in initialize
    await self._handle_event(EventType.RESOURCE_ADDED, item)
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 209, in _handle_event
    raise exc
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 200, in _handle_event
    cur_item = self._items[item_id] = dataclass_from_dict(
                                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohue/util.py", line 244, in dataclass_from_dict
    field.name: _parse_value(
                ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohue/util.py", line 202, in _parse_value
    raise KeyError(f"`{name}` of type `{value_type}` is required.")
KeyError: "`Light.owner` of type `<class 'aiohue.v2.models.resource.ResourceIdentifier'>` is required."

Additional information

No response

home-assistant[bot] commented 1 week ago

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

Code owner commands Code owners of `hue` 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 hue` 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)


hue documentation hue source (message by IssueLinks)

calvinrw commented 13 hours ago

Thanks for reporting this. I've encountered a very similar issue on my instance:

What version of Home Assistant Core has the issue?

2024.9.2

What was the last working version of Home Assistant Core?

2024.6.4

What type of installation are you running?

Home Assistant OS 13.1

Logger: homeassistant.components.hue.bridge
Source: components/hue/bridge.py:78
integration: Philips Hue (documentation, issues)
First occurred: 21:17:24 (1 occurrences)
Last logged: 21:17:24

Unknown error connecting to Hue bridge
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 78, in async_initialize_bridge
    await self.api.initialize()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 108, in initialize
    await self.fetch_full_state()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 252, in fetch_full_state
    await asyncio.gather(
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 336, in initialize
    await resource_control.initialize(initial_data)
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 80, in initialize
    await self._handle_event(EventType.RESOURCE_ADDED, item)
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 209, in _handle_event
    raise exc
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 200, in _handle_event
    cur_item = self._items[item_id] = dataclass_from_dict(
                                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohue/util.py", line 244, in dataclass_from_dict
    field.name: _parse_value(
                ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohue/util.py", line 202, in _parse_value
    raise KeyError(f"`{name}` of type `{value_type}` is required.")
KeyError: "`GroupedLight.owner` of type `<class 'aiohue.v2.models.resource.ResourceIdentifier'>` is required."
calvinrw commented 13 hours ago

This thread appears to discuss the same aiohue issue and a possible fix in a different project: https://github.com/diyhue/diyHue/issues/1032