Though lifxlan is a Python module, it certainly does what you’re looking for, and it might be helpful if you want to reverse engineer the LAN packets so that you can build your own in C#. The following code flashes the light a nice, eye-catching cyan and also prints out the packet information used to do so:
from lifxlan import Light, CYAN
light = Light("AB:CD:EF:GH:IJ:KL", "192.168.X.X", verbose=True)
light.set_waveform(True, CYAN, 1000, 2, 0, 4)
In my case, running this code prints out to the terminal each packet’s message type and associated field values, as well as the raw bytes of the entire packet:
SEND: LightSetWaveform
Size: 57
Origin: 0
Tagged: 0
Protocol: 1024
Source ID: 64384
Target MAC Address: d0:73:d5:12:c6:4e
Ack Requested: 1
Response Requested: 0
Seq Num: 0
Message Type: 103
Payload:
Is Transient: True
Color: [29814, 65535, 65535, 3500]
Period: 1000
Cycles: 2
Duty Cycle: 0
Waveform: 4
Bytes:
['0x39', '0x0', '0x0', '0x14', '0x80', '0xfb', '0x0', '0x0', '0xd0', '0x73', '0xd5', '0x12', '0xc6', '0x4e', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x2', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x67', '0x0', '0x0', '0x0', '0x0', '0x1', '0x76', '0x74', '0xff', '0xff', '0xff', '0xff', '0xac', '0xd', '0xe8', '0x3', '0x0', '0x0', '0x0', '0x0', '0x0', '0x40', '0x0', '0x0', '0x4']
RECV: Acknowledgement
Size: 36
Origin: 0
Tagged: 0
Protocol: 1024
Source ID: 64384
Target MAC Address: d0:73:d5:12:c6:4e
Ack Requested: 0
Response Requested: 0
Seq Num: 0
Message Type: 45
Payload:
<empty>
Bytes:
['0x24', '0x0', '0x0', '0x14', '0x80', '0xfb', '0x0', '0x0', '0xd0', '0x73', '0xd5', '0x12', '0xc6', '0x4e', '0x0', '0x0', '0x4c', '0x49', '0x46', '0x58', '0x56', '0x32', '0x0', '0x0', '0x68', '0x34', '0x89', '0xe7', '0x52', '0x9', '0x7c', '0x15', '0x2d', '0x0', '0x0', '0x0']
Hopefully that’s helpful in your mission! Also, if you don’t want to bother logging on to your router, you can get the IP and MAC address of the bulb (and other juicy info) by running hello_world.py in the examples folder.