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
73.67k stars 30.8k forks source link

Philips Hue Integration: Unable to add scene (continuation of 109362) #120418

Open majkers opened 4 months ago

majkers commented 4 months ago

The problem

Just like mentioned in https://github.com/home-assistant/core/issues/109362 still getting error with hue scene adding although I can see them in integration realted entities...

image

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant OS

Integration causing the issue

6.6.31-haos-raspi

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?

2024-06-25 14:40:18.649 ERROR (MainThread) [homeassistant.components.scene] Error adding entity scene.hue_zyrandol_przy_tv_lampka_nocna for domain scene with platform hue
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish
    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'

Additional information

No response

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

somansch commented 4 months ago

I have exactly the same issue. I've created three new scenes with HUE app, but they are not synced to HA: image

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'

marcelveldt commented 3 months 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.

majkers commented 3 months ago

No. Stil having errors on 2024.7.4

` Rejestrator: homeassistant.components.scene Źródło: helpers/entity_platform.py:598 integracja: Scena (dokumentacja, Problemy) Pierwsze zdarzenie: 12:16:10 (21 zdarzenia) Ostatnio zalogowany: 12:16:10

Error adding entity scene.hue_sypialnia_jasne for domain scene with platform hue Error adding entity scene.hue_salon_przyciemnione for domain scene with platform hue Error adding entity scene.hue_zyrandol_przy_tv_czytanie for domain scene with platform hue Error adding entity scene.hue_zyrandol_przy_tv_jasne for domain scene with platform hue Error adding entity scene.hue_zyrandol_przy_tv_lampka_nocna for domain scene with platform hue Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1362, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1072, 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 2 months ago

Unfortunately, this issue still exists (also in 2024.9.1). Same error: `Logger: homeassistant Quelle: components/hue/scene.py:133 Erstmals aufgetreten: 8. September 2024 um 16:52:18 (98 Vorkommnisse) Zuletzt protokolliert: 10:08:23

Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohue/v2/controllers/base.py", line 259, in _handle_event callback(evt_type, cur_item) File "/usr/src/homeassistant/homeassistant/components/hue/v2/entity.py", line 138, in _handle_event self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state self.async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in async_calculate_state if extra_state_attributes := self.extra_state_attributes: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/hue/scene.py", line 189, 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'`

chrisg30 commented 1 month ago

I have been running into this as well but from #115375 I tracked it down to scenes I'd created using the Hue Essentials app. Deleted the scene, created it in the Philips Hue app and the scene now works in HA.

alistairg commented 23 hours ago

I'm having this issue now also, and scenes that are newly created using either the official Hue app and/or iConnectHue fail. Interestingly scenes created earlier in the year (potentially before the October Hue update was automatically applied) work fine...