home-assistant-libs / aiohue

Python3 asyncio package to talk to Philips Hue
Apache License 2.0
59 stars 34 forks source link

Error in Hue integration after updating to 2022.2.7 and 2022.2.8 - Hue does not startup anymore #116

Closed mehdic closed 2 years ago

mehdic commented 2 years ago

I saw the solution provided (related to the motion sensor) but it doesnt exactly relate to me. I dont have any Philips Hue motion sensors, only Lights and Buttons.

I do have in fact a TV Zone created in my Hue App. Should i maybe delete it ? will that help ?

Here is my error :

`Logger: homeassistant.components.hue.bridge Source: components/hue/bridge.py:75 Integration: Philips Hue (documentation, issues) First occurred: 12:25:43 PM (2 occurrences) Last logged: 12:32:58 PM

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 104, in initialize await self.fetch_full_state() File "/usr/local/lib/python3.9/site-packages/aiohue/v2/init.py", line 242, in fetch_full_state await asyncio.gather( File "/usr/local/lib/python3.9/site-packages/aiohue/v2/controllers/base.py", line 312, 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 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 field.name: _parse_value( File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 147, in _parse_value return [ File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 148, in _parse_value(name, subval, get_args(value_type)[0]) 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 field.name: _parse_value( File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 147, in _parse_value return [ File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 148, in _parse_value(name, subval, get_args(value_type)[0]) 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 field.name: _parse_value( File "/usr/local/lib/python3.9/site-packages/aiohue/util.py", line 184, in _parse_value raise TypeError( TypeError: Value 1 of type <class 'int'> is invalid for Position.y, expected value of type <class 'float'>`

marcelveldt commented 2 years ago

This is related to the issue we had with the motion sensors. The data does not match with the models of the API. This is either because Signify needs to update their documentation or the data is in fact invalid due to a bug or a device issue etc.

I've looked in the code and indeed the only resource that uses the Position object is the entertainment space. So as temporary solution you could just remove the entertainment zone from the Hue app. I'll submit a bugfix to update the model.

marcelveldt commented 2 years ago

Maybe it is enough just to change the position of the lights a tiny bit so the value will no longer be exactly 1

mehdic commented 2 years ago

Ok, I deleted my entertainement areas, then update to 2022.2.8 and its working fine now. Thanks for your help. Will wait for the next update to recreate my areas.

marcelveldt commented 2 years ago

OK, thanks for reporting back and nice that the workaround is working now. Please keep the issue open for others as reference. We'll close this issue once the fix is released. Thanks!