Control Hue, Sat, Kelvin, and Brightness Individually

I have a little bit problem regarding controlling hue, sat, kelvin, and brightness Individually .

I have a question how can I set increase the brightness value without changing the existing hue and sat?

Because issue that I found, if I does not add any value for hue and sat (which mean 0) during sending message to increase the brightness, the light will changed the color to red and then it will adjust the brightness. I don’t want it to change color, I just want it to increase the brightness.

Help me. Thank you in advance.

Hi Adam,

To maintain the hue, I do a GetColor request to retrieve the current Hue, Brightness, Kelvin and Saturation values. I then structure my packets to maintain some of the existing values and adjust the parameters depending on my use-case. You can do this with a setColor send packet request. So it’s a GetColor, then SetColor sequence of requests.

1 Like

Hi firedance,

Thank you for your respond, I do appreciated it.

Currently I’m developing application that may control lifx light through other physical device and it’s not quite really convenient to keep asking the status because it will delay the process. So I’m wondering, do they have function where I can increase the brightness without effecting the colour and without my device to store the previous value of hue, sat, and kelvin? If they do have this functionality, may I have the link to the documentation.

Thank you.

Hi Adam, thanks.

I understand what you mean. Unfortunately, they do not have a way to do this over UDP. The packet has to be constructed with the existing parameters for Hue/Sat/Kelvin/Brightness/Duration.

I perform the same operations in a low-level implementation of Rust with UDP and it seems to work really fast for me. Is your code in Java? Does your code await a response from the LiFX device(s) after you send the setColor packet? If so, would you be able to get rid of awaiting the response from the devices and performing a “fire and forget?”

Alternatively, you could try the setLightPower state. The duration is adjustable, which will make the light appear as if the brightness is fluctuating.

1 Like

Yes, they do. Use the SetWaveformOptional packet which allows you to specify one or more of the HSBK values to change instead of requiring all of them. The bulb will then calculate and perform the transform between the current and target state.