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:
2600001418DD0000D073D53D032900004C49465856320100D0D8E89E4700000076000000FFFF
This is the binary string I receive for Get Power when the light is off:
2600001418DD0000D073D53D032900004C4946585632010040F0FBB892000000760000000000
This is the binary string I receive for Get when the light is on:
5800001418DD0000D073D53D032900004C4946585632010020B4C88D5C0000006B00000000000000FFFFAC0D0000FFFF414C4552544552
This is the binary string I receive for Get when the light is off:
5800001418DD0000D073D53D032900004C4946585632010060C1CBCBA50000006B00000000000000FFFFAC0D00000000414C4552544552
(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?
Thanks,
Barry.