LIFX Developer Zone

Building a LIFX packet


Can you share the code you’re using? I would like to try that out as well.

In my own project, I use the node-lifx library, but I don’t know what it’s actually doing under the hood. It might be worth looking into; specifically this file which assembles a packet:

Using this folder of packets:


Thanks for the answer.

I didn’t write any code yet. I tried to understand how it works first. I used the application Packet Sender, where I entered the long hexedecimal expression in HEX field, the ip address of the bulb in Address field, 56700 in Port field, slected UDP and then Send. However, nothing happens.

I also tried to use node-lifx library but failed to make it work. In examples/interactive-cli.js, I added some parameters as follows:
address: ‘’, // this is the ip address of the wifi interface
broadcast: ‘’, // got this by running ipconfig
lights: [‘’] // this is the ip address of the lifx bulb

However, nothing happened, even with the discovery turned on or off. Is there any missing parameter/configuration?
Thanks again,


That’s strange. I just init without any parameters as it will auto-discover using my machine’s IP range etc. If your lights are on a different network, that’s when you’ll wanna put in that info.

When you say “nothing happened”, what do you mean? There should be a callback function that you pass into the discovery function such as lifxClient.init().on('light-new', () => {})

Here’s a project I wrote that does just that:


I was digging around for an example on how to build and send @daniel_hall 's packet using Ruby but couldn’t find one. Pasting this here in case anyone finds it useful:

#!/usr/bin/env ruby

lifx_message = "310000340000000000000000000000000000000000000000000000000000000066000000005555FFFFFFFFAC0D0004000"

# split string to 2 chars in an array and convert each char pair to hex values
udp_payload = lifx_message.scan(/../).map { |s| sprintf("0x%s", s).hex }

# pack all (*) hex values as 8-bit unsigned (C)
udp_payload = udp_payload.pack('C*')

UDP_HOST   = "" # broadcast to subnet with 255, or the IP address of specific bulb
UDP_PORT   = 56700

# build socket, send broadcast option and send the packet
socket =
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
socket.send(udp_payload, UDP_FLAGS, UDP_HOST, UDP_PORT)

puts "done!"

It’s a shame there is no more Ruby LAN Protocol support since the original lifx-gem is defunct. Using bindata (as the original gem did) - it should be pretty straightforward to build one…


If anyone would find it helpful, I have created Java libraries for working with Lifx smart lights. You can download the source code here:


I see that there is set group and get group…but maybe I am misreading its intent. Can I use the group unique ID tags to set power state via broadcast. I cant imagine sending unicast to 75 bulbs are being efficient.

Would like to use broadcast with unique group addresses to control multiples lights (large scale.)


Hi, Thanks for the code.
Is it possible do this in Java?