lopter/lightsd

Add notes how to set one part of color or temp

gduprey opened this issue · 8 comments

Howdy! The LIFX LAN protocol allows you to change just part of a color -- change hue or saturation or brightness or a combination. Given the set_light_state call format for lightsd, how do you indicate which parameters have valid values for the set_light_state and which should be ignored for that call? (null value, -1/invalid value, etc)

Things I'm looking for:

  • Set Hue with no change to saturation/bright
  • Set Bright with no change to hue/saturation
  • Set Kelvin with no change to Hue/Sat/Bright

It would be helpful if that was part of the documentation.

Thanks!

Hello @gduprey,

You can make a get_light_state call, compute the new hue, saturation, brightness and kelvin values and then issue a new set_light_state?

All those parameters are mandatory for set_light_state.

Thanks for the reply! I thought about that, but how do you select a color (h/s/b) vs a color temp (k) then?

For example, if I send h/s/b/k of 120,1.0,0.5,2800 - do I get a green light or a warm-white light?

Hmmm....

Reading over the LIFX LAN protocol, it's almost as if the 'k' value is ignored unless the 's' value is 0 or near zero. That's a little on the "implied" side to me, but I guess I can see it.

And to further answer my own question, using a 'k' value of 3500 seems to be the 'default' white value (so technically, a h/s/b/k of 0,0,1,3500 should be about RGB #FFFFFF - I think ;-)

Ah sorry, I see the confusion now!

Indeed, I should totally document that: if hue and saturation are at 0 then you're manipulating whites, otherwise you're manipulating a color.

I'll add this to the documentation.

Let me know if you have any other question!

Apparently kelvin is always used by the bulbs according to this post:

https://community.lifx.com/t/interpolating-colors-whites/573/6

Looks good and helps clear things up! It might be helpful to those looking for a "neutral" kelvin point to state that 3500 seems to be the kelvin to use when trying to just do accurate colors. From testing with their app and review various code bits, that 3500 seems to be the "no tinting color"/neutral K value. Just a thought.

3500K is indeed the default value used by LIFX.

Do you think I should add a small paragraph explaining warm (2500-4000K) vs "natural" (4000-5000K) vs cool (5000-9000K) whites?

Hmmm.. My gut says folks programming for these bulbs likely understand the basics of color temps. But (for me), once I knew the K was always present, I wanted to know what value of K has the least impact/tinting when I was trying to do colors. I think it can have value for that reason. In short:

  • When focusing on colors, set K to 3500 to make colors most "accurate"
  • When focusing on whites, set H & S to 0 to make whites most "accurate"

Of course some sophisticated folks may want to play with tinting colors, but the above is a "best match" for the app behavior and a good starting point.

All IMHO, of course.