kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
114 stars 37 forks source link

HomeKit to WiZ color picker issue found! #115

Open MoTechnicalities opened 1 year ago

MoTechnicalities commented 1 year ago

@kpsuperplane

I found out why the plugin color translation is wrong. (Not that I know how to fix it - yet.) Both the WiZ App and the Home App use separate pickers for RGB saturation settings vs. Temperature Kelvin settings.

The plugin is incorrectly using Temperature in HomeKit-to-WiZ bulb translation to saturate the bulb's RGB settings instead of using the W (White) LED.

For the bulb's internals, I found that maximum RGB saturation using the WiZ App color picker yields R:255, G:255, B:255, W:140. Note that no Temperature is set in RGB mode. Conversely, no RGB settings are used in Temperature mode but only the C and W diodes.

Compare similar Home App vs. WiZ App color picker selections below.

In the WiZ RGBCW bulbs, the use of Temperature settings employs the C (Cool white) LED, but it is not supposed to be used at all in the bulb's RGB mode. The plugin will need to be corrected to use the White LED for saturation.

image

image

Compare

image

image

MoTechnicalities commented 1 year ago

Yep! This says it all! HAP 9.21 Color Temperature This characteristic describes color temperature which is represented in reciprocal megaKelvin (MK-1) or mirek scale. (M = 1,000,000 / K where M is the desired mirek value and K is temperature in Kelvin)

  1. Apple-defined Characteristics If this characteristic (Color Temperature) is included in the ”8.23 Light Bulb”, ”9.44 Hue” and ”9.82 Saturation” must not be included as optional characteristics in ”8.23 Light Bulb”. This characteristic must not be used for lamps which support color.
MoTechnicalities commented 1 year ago

An Excel spreadsheet that I made to demonstrate my proposed HomeKit to WiZ Bulb functionality. The cells of the spreadsheet are protected except for the yellow highlighted cells. The functions found in the cells would have to be translated to the Typescript plugin.

https://www.dropbox.com/s/ani3eimwi54avda/HomeKit%20to%20WiZ%20Bulb.xlsx?dl=0