core: KeyError in Hue integration after updating to 2022.2.7 - Hue does not startup anymore

The problem

Hello, I get an issue after upgrade with hue integration where the bridge can’t connect anymore. I try first a restart but nothing helped, so I do a rollback and it’s ok. Probably something added in this latest version.

See logs for more details

I’m in latest bridge version (last week, there was an update to 1.49.1949203030)

Thank you, Zigomatic

What version of Home Assistant Core has the issue?

core-2022.2.7

What was the last working version of Home Assistant Core?

core-2022.2.6

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?

2022-02-16 09:56:01 ERROR (MainThread) [homeassistant.components.hue.bridge] Unknown error connecting to Hue bridge
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 75, in async_initialize_bridge
    await self.api.initialize()
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/__init__.py", line 103, in initialize
    await self.fetch_full_state()
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/__init__.py", line 241, in fetch_full_state
    await asyncio.gather(
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/controllers/base.py", line 306, in initialize
    await resource_control.initialize(initial_data)
  File "/usr/local/lib/python3.9/site-packages/aiohue/v2/controllers/base.py", line 80, in initialize
    resource: CLIPResource = dataclass_from_dict(self.item_cls, item)
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 206, in dataclass_from_dict
    **{
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 207, in <dictcomp>
    field.name: _parse_value(
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 144, in _parse_value
    return dataclass_from_dict(value_type, value)
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 206, in dataclass_from_dict
    **{
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 207, in <dictcomp>
    field.name: _parse_value(
  File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 178, in _parse_value
    raise KeyError(f"`{name}` of type `{value_type}` is required.")
KeyError: "`MotionSensingFeature.motion` of type `<class 'bool'>` is required."

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 35 (15 by maintainers)

Most upvoted comments

For everyone hit by this issue: Just enable any disabled Hue motion sensors with the Hue app and restart HA. A fix will be provided in an upcoming HA bugfix release

@SeraphimSerapis just enable the sensors from the Hue app and it will work again.

@mehdic please do not hijack (closed) issues. Your issue seems to be a bit similar to the earlier issue with motion sensors but in fact different. From the top of my head this might be caused by any entertainment zones as those use the position schema.

Can you please create a new issue report with all details filled in, including a properly formatted version of your error ? Thanks!

Marcel thanks for all the help. Looks like the batteries in the sensors were low. I replaced them and all is working now. Much appreciated.

FYI; I switched ON the motion sensor in HA 2012.2.6 and do upgrade. Everything is working fine in 2012.2.7.

@zigomatichub the error you mention is fixed in the 2022.2.7 hotfix

OK, I’ve managed to reproduce it. It happens when the motion sensor is disabled. I will adjust our code for that but in fact this is an error in the Signify API