Scripting the colorful LEDs in my office

Finally, Wireshark to the rescue, I got my LimitlessLED home office RGB LEDs scripted.

In plain English: I can now send commands from a computer to my lights via WiFi and their base station, and they will turn on or off or red or blue or bright-white or “party” or whatever. While I previously could do that with their remote control, and via their iPhone app, now I can do it directly, from software I control. Which opens up all sorts of possibilities …

I wanted to do that ever since I got the lights, but the very confusing documentation on their developer site is just about incomprehensible and I couldn’t get it to work.

So for reference, this is how it works (for me, they have different models and the codes may be slightly different for your model):

  • All commands are two bytes long and sent over UDP.
  • The base station listens at port 8899.
  • The easiest way to send those two bytes is plain-old echo, and netcat, like this:
echo -n -e "\x22\x00" | nc -u 192.168.100.105 8899 -w 0
  • Here I’m sending 0x22 followed by 0x00, if the IP address of the base station is 192.168.100.105.
  • Here are the commands I know of it understands (from having Wireshark watch the iPhone app talk to the base station), all in hex:
off 2100
on (last state) 2200
long on (all go all bright) a200
increase brightness 2300
decrease brightness 2400
colors starting with blue 2000
…through the color circle back to blue 20ff
e.g. red 20af
e.g. yellow 207s
light show 1 2700
light show 2 2800
zone 1 on 4500
zone 1 off 4600
zone 2 on 4700
zone 2 off 4800
zone 3 on 4900
zone 3 off 4a00
zone 4 on 4b00
zone 4 off 4c00

If the top bit is set, it means “the button was pressed long” (e.g. a100 vs 2100). If the first byte starts with 4 instead of 2, it means “brighter”.

Which possibilities? Lots of them, like:

  • Turn the lights on automatically (and gradually) as it gets dark outside.
  • Flash the lights in red 5 min before my next conference call.
  • Flash the lights in green somebody is at the front door.
  • Turn on party lights for 5 min every hour of work, to remember the get up and move around.

There will be more ideas ...

Update Feb. 2018: More content for the above table. And there’s some code to drive this at github.com/jernst/milight.


Posted

in

,

by