ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
135 stars 7 forks source link

Philips Hue Color Bulbs - Hue NaN #161

Closed reachteh closed 11 months ago

reachteh commented 11 months ago

Hi, This evening, I switched from the old homebridge-hue plugin to the new deCONZ plugin. I have deCONZ running with a RaspBee module and lights from various manufacturers.

After setting everything up, I noticed that all the Philips Hue Color bulbs, Blooms, and Play bars were not updating their status in the Home app. I checked the console in Homebridge and saw strange errors like:

[06/09/2023, 21:49:29] [deCONZ] Z Bloom 2: Hue: set to null° (from null°)
[06/09/2023, 21:49:29] [homebridge-deconz] This plugin generated a warning from the characteristic 'Hue': characteristic value expected a valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.

I removed some lights from the cache and tried grouping them again, but the error persists for all the Philips color lights. However, Tradfri Color and Lidl LED strips are working fine.

I've attached the debug log.

I'm unsure if this is a bug or a misconfiguration on my part. homebridge.log

Thank you for your dedication and hard work on these plugins over the years.

ebaauw commented 11 months ago

This is a bug in deCONZ: the API reports an invalid gamut for the light, which causes the xy to Hue and Saturation conversion to fail:

[06/09/2023, 21:38:59] [deCONZ] Z Bloom 2: /lights/3: polled: {
  "capabilities": {
    "alerts": [
      "none",
      "select",
      "lselect",
      "blink",
      "breathe",
      "okay",
      "channelchange",
      "finish",
      "stop"
    ],
    "bri": {
      "min_dim_level": 0
    },
    "color": {
      "effects": [
        "none",
        "colorloop"
      ],
      "gamut_type": null,
      "modes": [
        "effect",
        "hs",
        "xy"
      ],
      "xy": {
        "blue": [
          0,
          0
        ],
        "green": [
          0,
          0
        ],
        "red": [
          0,
          0
        ]
      }
    }
  },
  "colorcapabilities": 15,
  "config": {
    "bri": {
      "startup": "previous"
    },
    "color": {
      "xy": {
        "startup": [
          0,
          0
        ]
      }
    },
    "groups": [
      "0",
      "5"
    ],
    "on": {
      "startup": "previous"
    }
  },
  "etag": "9182e1059d2b2c60f69aff39b2bad849",
  "hascolor": true,
  "lastannounced": null,
  "lastseen": "2023-09-06T20:38Z",
  "manufacturername": "Philips",
  "modelid": "LLC011",
  "name": "Z Bloom 2",
  "state": {
    "alert": "none",
    "bri": 84,
    "colormode": "xy",
    "effect": "none",
    "hue": 5932,
    "on": true,
    "reachable": true,
    "sat": 203,
    "xy": [
      0.5993,
      0.3639
    ]
  },
  "swversion": "5.23.1.13452",
  "type": "Color light",
  "uniqueid": "00:17:88:01:06:56:3a:f4-0b"
}

Probably because deCONZ hasn't yet read the corresponding attributes from the Color Control cluster. If you read these manually in the deCONZ GUI, the capabilities/color/xy items should be populated. It wouldn't hurt to read the attributes of the other clusters as well, while you're at it.

reachteh commented 11 months ago

Thank you for the quick response, i will try this in the evening.

reachteh commented 11 months ago

Good evening, short update from my side. I've disconnected the Blooms completly from deconz and re-paired them again, after that i have read all cluster attributes manually in the deconz gui. But the error is still the same, the lamps do not react in home app, but in phoscon app or when i set values manually in deconz they work. Homebridge log is also still the same

[07/09/2023, 19:05:18] [deCONZ] Z Bloom 1: Hue: changed to 35° (from null°)
[07/09/2023, 19:05:18] [deCONZ] Z Bloom 1: Saturation: changed to 75% (from null%)
[07/09/2023, 19:05:18] [deCONZ] Phoscon-GW: request 219: PUT /lights/31/state {"xy":[null,null]}
[07/09/2023, 19:05:18] [deCONZ] Phoscon-GW: warning: request 219: /lights/31/state/xy: api error 7: invalid value, , for parameter, xy

image

Edit: For testing i've reactivated the homebridge-hue plugin (v0.13.56), with that the blooms working fine in home app

[07/09/2023, 19:25:27] [Hue] Z Bloom 1: homekit saturation changed from 37% to 75%
[07/09/2023, 19:25:27] [Hue] Z Bloom 1: homekit hue changed from 282˚ to 35˚
[07/09/2023, 19:25:27] [deCONZ] Z Bloom 2: Hue: set to null° (from null°)
[07/09/2023, 19:25:27] [homebridge-deconz] This plugin generated a warning from the characteristic 'Hue': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[07/09/2023, 19:25:27] [deCONZ] Z Bloom 2: Saturation: set to null% (from null%)
[07/09/2023, 19:25:27] [homebridge-deconz] This plugin generated a warning from the characteristic 'Saturation': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.

(Bloom 1 = Bloom 2 | Just named the one diffrently after re-pairing)

ebaauw commented 11 months ago

Can you please double-check that all attributes of the Color Control cluster have been read, in particular the 0x003x range?

Can you please double-check that the deCONZ API now reports non-null values for capabilities/color/gamut_type and capabilities/color/xy/...

reachteh commented 11 months ago

hit the read button again, this is how the values look like. image image image image image image

and thats from the debug log [08/09/2023, 16:38:50] [deCONZ] Z Bloom 1: /lights/30: polled: {"capabilities":{"alerts":["none","select","lselect","blink","breathe","okay","channelchange","finish","stop"],"bri":{"min_dim_level":0},"color":{"effects":["none","colorloop"],"gamut_type":null,"modes":["effect","hs","xy"],"xy":{"blue":[0,0],"green":[0,0],"red":[0,0]}}},"colorcapabilities":15,"config":{"bri":{"startup":"previous"},"color":{"xy":{"startup":[0,0]}},"groups":["5"],"on":{"startup":"previous"}},"etag":"4dd838d16fa41623a5b94959dcd1e344","hascolor":true,"lastannounced":null,"lastseen":"2023-09-08T15:37Z","manufacturername":"Philips","modelid":"LLC011","name":"Z Bloom 1","state":{"alert":"none","bri":188,"colormode":"xy","effect":"none","hue":38400,"on":false,"reachable":true,"sat":200,"xy":[0.53,0.4116]},"swversion":"5.23.1.13452","type":"Color light","uniqueid":"00:17:88:01:06:56:3a:f4-0b"}

am i doing something wrong? TY

ebaauw commented 11 months ago

This is weird; my Bloom (LLC011, firmware 67.93.11) does not support the intensity attributes (0x0034, 0x0038, 0x003C), and does provide actual values for the RGB color points (0x0032, 0x0033, 0x0036, 0x0037, 0x003A, 0x003B). I also find it very worrying that the Current X and Current Y are greyed out.

Since your Bloom identifies as LLC011 as well, it should be a proper Hue Bloom of the 1st generation (and not a pre-Hue Living Colors light). However its firmware, 5.23.1.13452, is ancient, probably before 2017. This might be reflected in the Date Code on the Basic cluster (mine reads 20220502). Could you double-check that it's indeed Image Type 0x0103, and try to update the firmware? The firmware file should be at https://otau.meethue.com/storage/ZGB_100B_0103/5509a154-fe62-4cd3-bb11-19b46da0e074/LivingColors-Hue-Target_0012.sbl-ota.

ebaauw commented 11 months ago

The Play bars are rather new, so they should report the supported color gamut with their initial firmware. Still, you might check for firmware updates for new dynamic effects. I don't know what Hue Color bulbs you have; the first generation (gamut-B) could be as old as the Bloom and might also need newer firmware. The initial firmware of later versions (with Bluetooth) would probably be OK.

reachteh commented 11 months ago

thanks! firmware update for the bloom is currently running. image

I was also looking for firmware update before posting the issue but couldnt find it for LLC011 at this page: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/OTA-Image-Types---Firmware-versions

I will update here as soon the update is done. TY

ebaauw commented 11 months ago

It's listed with the OTA plugin, https://github.com/dresden-elektronik/deconz-ota-plugin, but I gave up maintaining that as well. Best source is https://github.com/Koenkk/zigbee-OTA. Homebridge deCONZ includes a command-line utility otau, that downloads all firmware filles listed there. I'm not sure the latest Hue firmware (see https://www.philips-hue.com/en-us/support/release-notes) is listed there yet, but that didn't include updates for these old lights.

reachteh commented 11 months ago

good morning, the blooms are updated and it seems that fixed the issue.

[09/09/2023, 08:10:17] [deCONZ] Z Bloom 1: /lights/30: polled: {"capabilities":{"alerts":["none","select","lselect","blink","breathe","okay","channelchange","finish","stop"],"bri":{"min_dim_level":10},"color":{"effects":["none","colorloop"],"gamut_type":"A","modes":["effect","hs","xy"],"xy":{"blue":[0.138,0.08],"green":[0.2151,0.7106],"red":[0.704,0.296]}}},"colorcapabilities":15,"config":{"bri":{"startup":254},"color":{"xy":{"startup":[0.4578,0.4101]}},"groups":["5"],"on":{"startup":true}},"etag":"85eff0d5266a4c665a3f53a817f84fb0","hascolor":true,"lastannounced":null,"lastseen":"2023-09-09T06:35Z","manufacturername":"Signify Netherlands B.V.","modelid":"LLC011","name":"Z Bloom 1","state":{"alert":"none","bri":155,"colormode":"xy","effect":"none","hue":9163,"on":true,"reachable":true,"sat":254,"xy":[0.3468,0.2288]},"swversion":"67.93.11","type":"Color light","uniqueid":"00:17:88:01:06:56:3a:f4-0b"}
[09/09/2023, 08:10:17] [deCONZ] Z Bloom 2: /lights/31: polled: {"capabilities":{"alerts":["none","select","lselect","blink","breathe","okay","channelchange","finish","stop"],"bri":{"min_dim_level":10},"color":{"effects":["none","colorloop"],"gamut_type":"A","modes":["effect","hs","xy"],"xy":{"blue":[0.138,0.08],"green":[0.2151,0.7106],"red":[0.704,0.296]}}},"colorcapabilities":15,"config":{"bri":{"startup":254},"color":{"xy":{"startup":[0.4578,0.4101]}},"groups":["5"],"on":{"startup":true}},"etag":"e232123cba5dcd2eab91c1abf943199c","hascolor":true,"lastannounced":null,"lastseen":"2023-09-09T07:10Z","manufacturername":"Signify Netherlands B.V.","modelid":"LLC011","name":"Z Bloom 2","state":{"alert":"none","bri":140,"colormode":"xy","effect":"none","hue":52958,"on":true,"reachable":true,"sat":171,"xy":[0.3468,0.2262]},"swversion":"67.93.11","type":"Color light","uniqueid":"00:17:88:01:06:56:52:43-0b"}

One of them is only reacting if controlled via group. But still a lot of OTAUs running for my lights, i will wait till everthing is updated and then reboot the system. After that lets see if everything is back to normal. otau CLT was working fine, really conviniant :) TY

ebaauw commented 11 months ago

Added a safety-net to revert to default gamut, in case deCONZ reports a gamut with all 0s.