diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.52k stars 274 forks source link

Error when trying to use Hue Festavia LCX012 lightstrip. #882

Open FredericGuardia opened 1 year ago

FredericGuardia commented 1 year ago

Describe the bug

Despite I set my Hue Festavia lightstrip to LCX02 / LCX04 or 915005987201 model inside diyhue web interface, nothing happens when I select my lighstrip inside Hue essentials or Hue philips app. I can't switch on/off or change lightstrip settings. When I check logs of my diyhue container this is what I get:

2023-01-06 14:05:22,908 - services.mqtt - DEBUG - MQTT: got state message on zigbee2mqtt/0x001788010d629539
2023-01-06 14:05:22,909 - services.mqtt - DEBUG - b'{"brightness":254,"color_mode":"xy","color_temp_startup":370,"device":{"applicationVersion":2,"dateCode":"20220928","friendlyName":"0x001788010d629539","hardwareVersion":1,"ieeeAddr":"0x001788010d629539","manufacturerID":4107,"manufacturerName":"Signify Netherlands B.V.","model":"929003535301","networkAddress":23441,"powerSource":"Mains (single phase)","softwareBuildID":"1.101.1","stackVersion":1,"type":"Router","zclVersion":8},"gradient":["#e342ff","#ea6bff","#ffb27b","#ffa642","#fffe54"],"last_seen":"2023-01-06T14:05:22+01:00","linkquality":94,"power_on_behavior":"previous","state":"ON","update":{"installed_version":16778496,"latest_version":16778496,"state":"idle"},"update_available":false}'
2023-01-06 14:05:22,912 - services.mqtt - DEBUG - Cache Hit for 0x001788010d629539
2023-01-06 14:05:22,918 - services.mqtt - DEBUG - MQTT: got state message on zigbee2mqtt/0x001788010d629539
2023-01-06 14:05:22,921 - services.mqtt - DEBUG - {
    "brightness": 254,
    "color_mode": "xy",
    "color_temp_startup": 370,
    "device": {
        "applicationVersion": 2,
        "dateCode": "20220928",
        "friendlyName": "0x001788010d629539",
        "hardwareVersion": 1,
        "ieeeAddr": "0x001788010d629539",
        "manufacturerID": 4107,
        "manufacturerName": "Signify Netherlands B.V.",
        "model": "929003535301",
        "networkAddress": 23441,
        "powerSource": "Mains (single phase)",
        "softwareBuildID": "1.101.1",
        "stackVersion": 1,
        "type": "Router",
        "zclVersion": 8
    },
    "gradient": [
        "#e342ff",
        "#ea6bff",
        "#ffb27b",
        "#ffa642",
        "#fffe54"
    ],
    "last_seen": "2023-01-06T14:05:22+01:00",
    "linkquality": 94,
    "power_on_behavior": "previous",
    "state": "ON",
    "update": {
        "installed_version": 16778496,
        "latest_version": 16778496,
        "state": "idle"
    },
    "update_available": false
}
2023-01-06 14:05:23,117 - services.eventStreamer - DEBUG - {'creationtime': '2023-01-06T13:05:22Z', 'data': [{'id': 'd280aa0f-6ea1-452f-a374-f4e554ef7612', 'type': 'light', 'on': {'on': True}, 'owner': {'rid': 'c560819e-f81a-51f1-95ee-5dd8ab24b72c', 'rtype': 'device'}}], 'id': 'bece2092-692e-4699-8635-0e0a556854fa', 'type': 'update', 'id_v1': '/lights/17'}
2023-01-06 14:05:23,118 - services.eventStreamer - DEBUG - {'creationtime': '2023-01-06T13:05:22Z', 'data': [{'id': 'd280aa0f-6ea1-452f-a374-f4e554ef7612', 'type': 'light', 'on': {'on': True}, 'dimming': {'brightness': 100.0}, 'owner': {'rid': 'c560819e-f81a-51f1-95ee-5dd8ab24b72c', 'rtype': 'device'}}], 'id': '8564b686-a549-40c1-ac12-0ff465333ca3', 'type': 'update', 'id_v1': '/lights/17'}
2023-01-06 14:05:23,120 - services.eventStreamer - DEBUG - {'creationtime': '2023-01-06T13:05:22Z', 'data': [{'id': 'd280aa0f-6ea1-452f-a374-f4e554ef7612', 'id_v1': '/lights/17', 'owner': {'rid': 'c560819e-f81a-51f1-95ee-5dd8ab24b72c', 'rtype': 'device'}, 'type': 'light', 'on': {'on': True}, 'dimming': {'brightness': 100.0}}], 'id': 'c8131b25-2b5b-4cc1-9296-ce00d1ec2cd1', 'type': 'update'}
2023-01-06 14:05:23,136 - services.eventStreamer - DEBUG - {'creationtime': '2023-01-06T13:05:22Z', 'data': [{'id': '1d2935fc-0b76-433a-879a-1fea68a67571', 'type': 'grouped_light', 'owner': {'rid': '5ae8a50c-2efb-5ad1-bbfd-5bed729fe3c1', 'rtype': 'room'}, 'on': {'on': True}, 'dimming': {'brightness': 100.0}}], 'id': 'f9b08077-b273-4443-a1f5-64806819f19f', 'type': 'update', 'id_v1': '/groups/8'}
2023-01-06 14:05:23,174 - werkzeug - INFO - 192.168.10.179 - - [06/Jan/2023 14:05:23] "GET /clip/v2/resource/light HTTP/1.1" 500 -
[2023-01-06 14:05:22,712] ERROR in app: Exception on /clip/v2/resource/light [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/hue-emulator/flaskUI/v2restapi.py", line 284, in get
    response["data"].append(light.getV2Api())
  File "/opt/hue-emulator/HueObjects/__init__.py", line 502, in getV2Api
    "points_capable": self.protocol_cfg["points_capable"]}
KeyError: 'points_capable'
2023-01-06 14:05:28,410 - werkzeug - INFO - 192.168.10.179 - - [06/Jan/2023 14:05:28] "GET /api/hueess52891b11edbac3b827eb9a262c HTTP/1.1" 200 -
2023-01-06 14:05:30,429 - services.stateFetch - INFO - start lights sync

Steps to Reproduce

  1. Integrate the lighstrip into your zigbee network (zigbee2mqtt).
  2. configure diyhue to retrieve devices from mqtt.
  3. start diyhue container et set into the web interface LCX04 / LCX02 or 915005987201 light model for the detected Hue Festava Lighstrip.
  4. Inside Hue essential or Hue philips app try to change settings for this light. The error appears at this moment inside diyhue app log.

Expected behavior

Having possibility to switch on/off, set different gradients colours and modes (mirror / random /symetric /...), and all available effects for this lighstrip.
Logs

see provided log in 'Describe the bug' step.

Docker Info (please complete the following information):

Checklist

Additional context

Support to this lightstrip, model 929003535301 (LCX012) has been added into z2mqtt very recently (december).

Mevel commented 1 year ago

Maybe we have to remap some fields. Checking

mariusmotea commented 1 year ago

Use LCX002 for this, for other two you will get KeyError: 'points_capable' From zigbee2mqtt dashboard are you are able to control this lightstrip?

FredericGuardia commented 1 year ago

From zigbee2mqtt dashboard I can switch on/off the lighstrip and select scenes /effects. As there are still some development for managing gradient lighstrip in a more general way, currently we can't set our own colors from the dashboard: this part is broken.this will probably work correctly with next update.

mariusmotea commented 1 year ago

Need to understand the api required for gradient points, this is something new since in Zigbee2mqtt din't had before support for a gradient device

FredericGuardia commented 1 year ago

I have tested with LCX002 just now, and I have differences behaviour betweeen Hue essentials and Philips Hue app. With Hue essentials app we can switch off/on lighstrip and change color but color is the same for all segment of the lighstrip. We can't change and set different colors for each segment. With Philips Hue app, we have freeze each time we select the light strip and we have same error as inside opened ticket regarding points_capable key.

2023-01-13 19:47:29,927 - werkzeug - INFO - 192.168.1.10 - - [13/Jan/2023 19:47:29] "GET /clip/v2/resource HTTP/1.1" 500 -
2023-01-13 19:47:30,800 - werkzeug - INFO - 192.168.1.10 - - [13/Jan/2023 19:47:30] "GET /clip/v2/resource/bridge HTTP/1.1" 200 -
2023-01-13 19:47:30,830 - werkzeug - INFO - 192.168.1.10 - - [13/Jan/2023 19:47:30] "GET /eventstream/clip/v2 HTTP/1.1" 200 -
[2023-01-13 19:47:30,927] ERROR in app: Exception on /clip/v2/resource [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/hue-emulator/flaskUI/v2restapi.py", line 236, in get
    data.append(light.getV2Api())
  File "/opt/hue-emulator/HueObjects/__init__.py", line 502, in getV2Api
    "points_capable": self.protocol_cfg["points_capable"]}

OK for your answer, it's something completely new and this feature is still in development in Zigbee2mqtt and not yet still stabilized. It's one point new and to develop inside your project, so feel free to take any decision you want on this issue(Keep it open or close it). From my side I am ready to test any future development on this point if you need.

mariusmotea commented 1 year ago

Hue Essentials provide both simple control (single segment) and multiple segments (points). Hue app always send requests with these "points" that currently is not implemented for mqtt protocol. Probably to support gradient we need only to add a convertedr from XY CIE colors to RGB HEX colors.

Gradient (list) List of RGB HEX colors. Can be set by publishing to zigbee2mqtt/FRIENDLY_NAME/set with payload {"gradient": []}

https://www.zigbee2mqtt.io/devices/929003535301.html

bassrock commented 1 year ago

To add I am seeing this with a real LCX002 paired to diyHUE with a regular hue bridge.

Trace:

023-01-14 13:32:47,843 - werkzeug - INFO - 192.168.6.138 - - [14/Jan/2023 13:32:47] "GET /eventstream/clip/v2 HTTP/1.1" 200 -
[2023-01-14 13:32:47,923] ERROR in app: Exception on /clip/v2/resource [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/hue-emulator/flaskUI/v2restapi.py", line 236, in get
    data.append(light.getV2Api())
  File "/opt/hue-emulator/HueObjects/__init__.py", line 502, in getV2Api
    "points_capable": self.protocol_cfg["points_capable"]}
KeyError: 'points_capable'
alexhulbert commented 4 months ago

I'm running into this issue as well. My signe gradient floor lamp is connected via an actual hue bridge. I'm happy to fix it if anyone can give me some pointers on what exactly needs to be done and where. Regardless of which gradient light strip type I set my phillips hue signe gradient strip to, I get this error when diyhue boots up. I temporarily hard coded the points_capable parameter to three so it doesn't throw an error when trying to get the state of the light, but setting scenes/individual segment colors has no effect.