bahamas10 / hue-cli

A command line interface to phillips hue
http://bahamas10.github.com/hue-cli/
221 stars 24 forks source link

3rd gen bulbs are set to wrong color #17

Closed caedn closed 7 years ago

caedn commented 7 years ago

Most notably when running hue lights all reset, all 3rd generation (not sure about 2nd generation) lights get a noticeable green color cast.

white works fine but some other predefined colors are slightly off too.

bahamas10 commented 7 years ago

ah. i know green had issues before, i wonder if those issues have been fixed and this program doesn't account for it. unfortunately i don't have any lights to test this.

Spire42 commented 7 years ago

I've fixed the green color cast on reset by changing line 173 of hue-cli.js to:

case 'reset': l.forEach(function(id) { client.state(id, {on: true, bri: 254, hue: 8418, sat: 140, effect: 'none', xy: [0.4573, 0.41], ct:366, alert: 'none'}, callback(id)); }); break;

I obtained these new values by physically power-cycling one of my LCT014 bulbs and then immediately dumping the state.

I've tested this with the following bulbs and they all look good:

bahamas10 commented 7 years ago

Thanks for looking up these values. According to the API:

There are 3 methods available to set the color of the light – hue and saturation (hs), xy or color temperature (ct). If multiple methods are used then a priority is used: xy > ct > hs. All included parameters will be updated but the ‘colormode’ will be set using the priority system.

I'm going to update this to use the ct parameter, as that is almost identical to the color of a 2700k (warm white) incandescent bulb, which is what I was attempting to recreate originally - I will also make sure to clear any alerts or effects as well.