Zacknetic / HomebridgeMagicHome-DynamicPlatform

Homebridge Plugin for MagicHome LED controllers and light bulbs
Apache License 2.0
61 stars 11 forks source link

Improve Color Temperature mapping (RGBWW) #54

Open isramos opened 3 years ago

isramos commented 3 years ago

The mapping for the RGBWW lamp is not accurate. In the desired setting I was expecting r:0 g:0, b:0, cw:0 ww255

image

Zacknetic commented 3 years ago

This is HK poor attempt to "convert" CCT data to hue/sat. This happens when a plugin does not implement the "color temperature" characteristic.

After implementing color temp characteristic, the color temp wheel will output a number between 140 and 500.

However, when color temperature is is implemented, moving the reticle on the color temp also moves the reticle in the RGB color wheel. So... we'll need to test that. Basically we need to disable HUE/Sat input while using the color temp wheel. That should do it.

I haven't attempted any of this in over a year so things may have improved.

isramos commented 3 years ago

I posted the question in Discord's Homebridge-Hue channel as those folks have done a lot of working around color: Hi all - I'm a developer helping out with the MagicHome plugin ( @Zacknetic ). I have a simple question about service.updateCharacteristic in Color Temperature mode. What do I report as Hue and Saturation when in CCT mode? null, zeros, or the conversion of cct to hue/sat. Is this the right channel to ask this question, if not, please direct me. Thanks!!! @ebaauw

Response: HomeKit doesn’t keep a mode, that’s part of the issue. Furthermore it does not display the colour temperature. You need to set Hue and Saturation to values corresponding to the colour temperature, for HomeKit to display the correct colour. See https://github.com/ebaauw/homebridge-hue/issues/814.

Another update: Apple is changing how it handles color Temperature in iOS 14.2. Today is DEC 1st and my phone is doing that update right now. So in short: this is a very fluid situation.

Zacknetic commented 3 years ago

Thanks for reaching out to them. Looks like you've got some valuable information. As for the update... yes lets see how that changes things. Hopefully for the better.

tom-23 commented 3 years ago

beta.6 might of fixed this issue. Let me know if there is more to work on.