I have a LifX Mini Day and Dusk bulb. I would like to control it using the LAN API.
My ultimate goal is to flash the bulb on and off at about a 1 Hz rate for about 10 seconds to use as an alerter – I am deaf.
I’ve written a Java program that runs on a Windows 10 PC to test controlling the bulb.
I can turn the bulb on and off, SetPower (117), and generate the binary string for SetColor (102) to confirm it matches the example.
But when I issue one of the get commands, GetPower (116) or Get (101), the response I receive does not seem to match the documentation.
This is the binary string (shown in HEX) I receive for Get Power when the light is 100% on:
This is the binary string I receive for Get Power when the light is off:
This is the binary string I receive for Get when the light is on:
This is the binary string I receive for Get when the light is off:
(Note: My UDP is set up to return a buffer of 200 bytes. I have artificially truncated the above strings at the point where the data seems to become all zeros. I may have truncated the strings too short by mistake)
For example, in the responses for GetPower I would expect to see FFFF/0000 in the 0 position, according to the LifX Light Messages documentation. I do see it at the very end of the string, but what’s all that other stuff? The Same for Get. If I try to match one for one with the documentation, the values just don’t make sense.
In the responses for the Get command I see the Hex string “4C494658” (LIFX), which would correspond to part of Label, but not at the position I expect.
Can someone help explain what I am seeing?
Second question: Is it better to use a waveform to flash the bulbs on an off (or bright and dark) than to actually issue on and off commands and a 1 Hz rate? How would I approach this with my Day and Dusk bulb?