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
70.11k stars 29.17k forks source link

Errors with Hue integration #115840

Open albaintor opened 3 months ago

albaintor commented 3 months ago

The problem

Hi, when I start Home assistant I have these errors in the logs 2024-04-19 08:42:53.140 ERROR (MainThread) [homeassistant.components.scene] Error adding entity scene.veranda_lampe_nesso_under_water_animation for domain scene with platform hue Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1059, in __async_calculate_state attr.update(self.extra_state_attributes or {}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hue/scene.py", line 186, in extra_state_attributes "is_dynamic": self.is_dynamic, ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hue/scene.py", line 133, in is_dynamic if self.resource.palette.color and len(self.resource.palette.color) > 1: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'color'

What version of Home Assistant Core has the issue?

core-2024.4.3

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

The integration seems to have errors with the management / reading of scenes

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 months 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)

voc0der commented 3 months ago

Looks like my previous issue: https://github.com/home-assistant/core/issues/115375

mvdwetering commented 3 months ago

From a quick look it seems that the code is accessing values in the palette object, but the palette object is not required on the bridge API. So I guess there is a scene without a palette.

rzarajczyk commented 1 month ago

Same here :-) I'm new to Home Assistant, wanted to integrate Hue with HA, but came across this issue.

somansch commented 3 weeks ago

Same issue here. I've vreated three new scenes, but they rae not snyced to HA. I'm getting same log: 2024-07-01 22:01:26.938 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1525, in _async_process_registry_update_or_remove self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1065, in __async_calculate_state if extra_state_attributes := self.extra_state_attributes: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hue/scene.py", line 186, in extra_state_attributes "is_dynamic": self.is_dynamic, ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hue/scene.py", line 133, in is_dynamic if self.resource.palette.color and len(self.resource.palette.color) > 1: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'color'

somansch commented 3 weeks ago

When can we get a fix? It's the same issue described here: https://github.com/home-assistant/core/issues/120418

Since this issue, none of new created scenes are synced to HA anymore!

Maybe, it's related to scenes with "White ambience" bulps?!

marcelveldt commented 3 weeks ago

I'll provide fixes for the Hue integration this Monday or Tuesday. I started working on it Friday but it was not yet ready

marcelveldt commented 2 days ago

This should most probably be fixed with https://github.com/home-assistant/core/pull/122651 (which ia targeted for 2024.7.4) but it needs to be confirmed.