I wanted a smart lamp shaped like a bunny that shows up in the Hue app next to my real Hue bulbs, changes color, and doesn’t cost 100 CHF. So I built one, and the firmware side took way less time than it should have, thanks to some help from AI. Some of the groundwork came from Zigbee: Hue-llo world! , a great write-up worth reading helped a lot to get into the Zigbee & Hue specifics.
Bunny & Hue ?
No real reason for the bunny, something wich will make a 2 years old girl happy, I just liked the shape and had a cheap plastic bunny lamp shell lying around from.
The Hue part is more interesting. The ecosystem and app are quite nice and very user friendly. Hue bulbs talk Zigbee, a low power wireless protocol a lot of smart home gear speaks, and Hue bridge will happily accept any Zigbee light that talks the right language, not just ones sold by Philips. Make a chip pretend to be a Hue bulb, and the Hue app, Alexa, and everything else just treats it like one.
The cheap hardware
For the brain, an ESP32-H2 dev board . It’s a tiny chip that costs a couple of Francs and, unlike most ESP32 boards, doesn’t even have WiFi. What it does have is native support for the 802.15.4 radio Zigbee runs on, exactly what was needed.
For the light, one of those cheap addressable RGB LED rings you can find for less than 3 CHF, the same kind people use for desk lamps and PC builds. Glue it inside the bunny base, wire three pins to the ESP32-H2, and that’s the whole bill of materials, next to nothing compared to an actual Hue bulb.
Where Claude Code came in
The painful part of projects like this is usually the firmware. Getting a chip to speak Zigbee well enough for a Hue bridge to accept it means digging through cluster definitions, device profiles, and Espressif’s Zigbee SDK docs. Normally that’s a weekend of reading specs, forums and web search and a lot of trials and errors.
This time I just described what I wanted to Claude Code: an ESP32-H2 acting as a Zigbee/HUE RGB light bulb, driving an RGB LED ring, that a Hue bridge would recognize and let me control. It scaffolded the whole ESP-IDF project, wired up the right Zigbee clusters, and wrote the driver code for the LED ring. The first working (bring up) binary was flashed something like 10 min later than the first promtp.
It was not a perfect first try, nothing is with real hardware. Some functionals bugs due to not specifying the hardware setup and components detailled enough and some hickups of claude code’s code generation. Bug, Feedback, let claude interacting directly with the console over usb. A couple of rounds of that, flash, look, describe, fix, and it was working but not pairing cleanly with the Hue bridge like a proper Hue light.
Grabbing the TCL Key
As explained in Wejn’s post and in other sources, the key protecting that handshake is called the Trust Center Link Key, and Philips doesn’t hand it out.
Unlike the plain Zigbee Home Automation profile, which ships a public default link key, Hue uses the older Zigbee Light Link profile, where the link key is a proprietary secret given only to manufacturers who sign an NDA and get certified. That’s exactly why sniffing was the only realistic option, there was no public key to look up.
The join handshake already hands a new device its network key automatically, but I wanted to see that moment happen and reuse the key directly in later builds, instead of redoing the join process on every reflash. So I asked Claude Code for a second, throwaway firmware image that just listens: put the ESP32-H2’s radio into promiscuous mode on the Zigbee channel and dump every raw frame to a PCAP file.
Before writing that sniffer, Claude Code stopped and asked me to confirm this was my own bridge and bulbs, not someone else’s network. Fair enough, a sniffer is a sniffer.
I put an existing Hue bulb into re-pair mode and let the sniffer catch the join handshake over the air. Claude walked me through loading the capture into Wireshark and finding the one packet that mattered, the bridge handing the real network key to the joining device, encrypted under that proprietary link key. From there the Bunny ESP32-H2 could use the recovered key directly and behave like a trusted official device.
The result
The bunny now lives in the Hue app like any other bulb. It can be dimmed, its color changed, put it in a scene, or have it pulse red when an automation fires, all for the price of a “croissant” in parts. The GenAI code what a really time saver, which make such projet much more affordable when you are lacking of precious time.