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
72.67k stars 30.42k forks source link

Philips Hue light LCX012 (Festavia string lights) has broken "unknown" effect #82264

Closed renssies closed 1 year ago

renssies commented 1 year ago

The problem

I'm probably on the cutting edge but I got the Philipe Hue Festavia string lights today. They function fine with Home Assistant except for the effects.

The string lights have a new "sparkle" effect, but in home assistant this appears as "unknown" and causes a 400 bad request when activating it. So far the sparkle effect seems limited to the string lights, the gradient strips do not have it.

Screen Shot 2022-11-17 at 13 30 40

What version of Home Assistant Core has the issue?

2022.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Philips Hue

Link to integration documentation on our website

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

Diagnostics information

config_entry-hue-200cee5590161ab5de97c7f1d2363468.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/hue/bridge.py:134 
Integration: Home Assistant WebSocket API (documentation, issues) 
First occurred: 1:15:55 PM (3 occurrences) 
Last logged: 1:17:09 PM

[2493444952] Request failed due connection error: 400, message='Bad Request', url=URL('https://10.0.1.112/clip/v2/resource/light/191f7732-280b-46c8-b1d2-58fcbb717abe')
[2520232888] Request failed due connection error: 400, message='Bad Request', url=URL('https://10.0.1.112/clip/v2/resource/light/191f7732-280b-46c8-b1d2-58fcbb717abe')
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 123, in async_request_call
    return await task(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohue/v2/controllers/lights.py", line 103, in set_state
    await self.update(id, update_obj)
  File "/usr/local/lib/python3.10/site-packages/aiohue/v2/controllers/base.py", line 159, in update
    await self._bridge.request("put", endpoint, json=data)
  File "/usr/local/lib/python3.10/site-packages/aiohue/v2/__init__.py", line 176, in request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://10.0.1.112/clip/v2/resource/light/191f7732-280b-46c8-b1d2-58fcbb717abe')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 570, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/hue/v2/light.py", line 211, in async_turn_on
    await self.bridge.async_request_call(
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 134, in async_request_call
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Request failed due connection error: 400, message='Bad Request', url=URL('https://10.0.1.112/clip/v2/resource/light/191f7732-280b-46c8-b1d2-58fcbb717abe')

Additional information

Due to the size of my hue setup and for a bit of privacy I've removed some lights, groups rooms etc from the diagnostics file's full state. I've left the string lights and a gradient lightstrip for comparison.

Also this is the full response of the gradient lightstrip from the V2 API if you are curious:

Full response of /clip/v2/resource/light/redacted-280b-46c8-b1d2-58fcbb717abe ```JSON { "errors": [], "data": [ { "id": "redacted-280b-46c8-b1d2-58fcbb717abe", "id_v1": "/lights/61", "owner": { "rid": "redacted-ab36-43eb-9ba8-3b2871d79880", "rtype": "device" }, "metadata": { "name": "Hue gradient string light 1", "archetype": "string_light" }, "on": { "on": true }, "dimming": { "brightness": 100.0, "min_dim_level": 5.0 }, "dimming_delta": {}, "color_temperature": { "mirek": null, "mirek_valid": false, "mirek_schema": { "mirek_minimum": 153, "mirek_maximum": 500 } }, "color_temperature_delta": {}, "color": { "xy": { "x": 0.1545, "y": 0.0968 }, "gamut": { "red": { "x": 0.6915, "y": 0.3083 }, "green": { "x": 0.17, "y": 0.7 }, "blue": { "x": 0.1532, "y": 0.0475 } }, "gamut_type": "C" }, "dynamics": { "status": "none", "status_values": [ "none", "dynamic_palette" ], "speed": 0.0, "speed_valid": false }, "alert": { "action_values": [ "breathe" ] }, "signaling": {}, "mode": "normal", "gradient": { "points": [ { "color": { "xy": { "x": 0.1545, "y": 0.0968 } } }, { "color": { "xy": { "x": 0.1545, "y": 0.0968 } } }, { "color": { "xy": { "x": 0.1545, "y": 0.0968 } } }, { "color": { "xy": { "x": 0.1545, "y": 0.0968 } } }, { "color": { "xy": { "x": 0.1545, "y": 0.0968 } } } ], "mode": "interpolated_palette", "points_capable": 5, "mode_values": [ "interpolated_palette", "interpolated_palette_mirrored", "random_pixelated" ], "pixel_count": 250 }, "effects": { "status_values": [ "no_effect", "candle", "fire", "sparkle" ], "status": "no_effect", "effect_values": [ "no_effect", "candle", "fire", "sparkle" ] }, "timed_effects": { "status_values": [ "no_effect", "sunrise" ], "status": "no_effect", "effect_values": [ "no_effect", "sunrise" ] }, "type": "light" } ] } ```
home-assistant[bot] commented 1 year 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` Change the title of 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.

(message by CodeOwnersMention)


hue documentation hue source (message by IssueLinks)

marcelveldt commented 1 year ago

First of all, don't worry about the diagnostics as they are completely anonymized and all id's scrambled. So for next time try to keep it intact please.

This is a complete new feature on the Hue platform and API so yes you are on the cutting edge :-) I'll try to get my hands on one of these lights myself so fix it, hopefully in time for Christmas. In the meantime I'm afraid you will have to control it manually with the Hue app.

renssies commented 1 year ago

Ok, the diagnostics file was 3000+ lines due to all the scenes, rooms and sensors so I wanted to do a favor, but will include the full state next time.

As for the effect, it's not really a new feature, it just an option next to "fire" and "candle" for the effect property. I assumed the hue integration just loaded the possible values that are present in the (V2) API and displayed them. So that's why it seemed more like a bug than a new feature.

As you can see from the response it does include "sparkle" in the possible values next to "fire" and "candle", but HA seems to display and send "unknown".

But if it needs more work, I'm happy to wait

marcelveldt commented 1 year ago

Well, in this case it's fine but some users have e.g. performance issues and in that case it's actually helpful to see if they crossed the 50 device limit or added a lot of non genuine lights.

My first response was that just the sparkle effect was missing but then I discovered that whole new "interpolated_palette " mode which is completely new to me. So I could just try to add the missing sparkle effect but I'm guessing there's more

renssies commented 1 year ago

interpolated_palette has nothing to do with the "sparkle" effect, "sparkle" works exactly the same as "candle" and "fire". It (sadly) has no options for speed or color.

Screenshot of the effects on the string lights ![IMG_7391](https://user-images.githubusercontent.com/830094/202461433-3b0d06d3-88ea-4ee3-9fed-dad6c2295d83.PNG)

interpolated_palette and interpolated_palette_mirrored aren't new. interpolated_palette is just gradient and interpolated_palette_mirrored is gradient, but start mirrored. I was incorrect, see this comment. They were introduced in a firmware update for the gradient products to allow for mirroring the strip. They appear als "linear" in the app. It has nothing to do with effects.

random_pixelated is new, and only available for the string lights. It is the "scattered" option within the app and scatters the light over the string, but it has nothing to do with effects. It only influences scenes, and colors.

Screenshot of the linear vs scattered option on the string lights ![IMG_7390](https://user-images.githubusercontent.com/830094/202461530-aab6ece3-6528-4b93-b03c-0ca4713e45ad.PNG)
marcelveldt commented 1 year ago

OK thanks, first time I've seen this hence the confusion. In that case it's as easy as adding the sparkle effect. It does need some investigation (do we even have a place for that in HA) at some point but as it now looks not for now. I plan to do some other Hue fixes too next week or so, so I can smash this one in too, assuming it's as easy as adding the effect only.

Off topic: What's the quality of the light btw, are you happy with it ? I'm tempted to buy one at some point but not sure if it's worth the price point compared to e.g. Twinkly.

renssies commented 1 year ago

If I had more python experience I would have submitted a fix myself. I checked it myself with some API calls to the V2 API and it is just as easy as setting the effect value to "sparkle" and that should be it.

My first impressions on the string lights:

I have personally only used the first gen twinkly, the triangle shaped box. But they had a flicker, the controller had a whining noise and after use the solder of the power cable just broke, customer support was very lacking at the time. I haven't tried any of the newer twinkly products since.

marcelveldt commented 1 year ago

No worries, I'm already glad you provide a lot of info and checked the API calls, that saves like 80% of the work ;-)

I do have a Twinkly (new gen) light here just because my wife purchased it on sale somewhere and I was impressed by the app and how easy it was to create the effects but I do like the build quality of Hue products, it has never disappointed me so far. Thanks for the info.

I'll let you know here once I created a patch for the missing effect.

renssies commented 1 year ago

Sorry I made a small mistake earlier, it's not related to the sparkle effect but it was something I mentioned here and wanted to clarify.

First interpolated_palette_mirrored is not available on the gradient lightstrip, but it is on some other gradient products, including these string lights. Second interpolated_palette is the gradient you might know from the gradient lightstrip, so if you set 3 colors: red, green blue it will transition from red, to green, to blue. interpolated_palette_mirrored is the gradient but from the middle to both sides (also the first color moves to the middle somehow). So if you set the same colors you get blue to green to red to green to blue.