Firmware for the Seeed XIAO ESP32-C6 that:
- Extends your Zigbee mesh as a ZHA router
- Detects room occupancy passively via WiFi probe request sniffing (no sensors needed)
- Exposes the onboard LED as a ZHA dimmable light (controllable from HA)
Visit the web flasher in Chrome or Edge with your XIAO connected via USB-C.
pip install esptool
esptool.py --chip esp32c6 write_flash 0x0 firmware-merged.binDownload firmware-merged.bin from Releases.
Requires Docker.
git clone https://github.com/adambenovic/esp32c6-zigbee-router
cd esp32c6-zigbee-router
make build
make flash PORT=/dev/ttyACM0
make monitor PORT=/dev/ttyACM0- Home Assistant → Settings → Devices & Services → ZHA → Add Device
- Power the XIAO — LED fast-blinks (scanning) then slow-blinks (joining)
- Device joins and appears with two entities: occupancy sensor + dimmable light
Edit and rebuild:
| Constant | File | Default | Meaning |
|---|---|---|---|
OCCUPANCY_TIMEOUT_SEC |
main/wifi_sniffer.h |
300 |
Seconds of silence → unoccupied |
WIFI_CHANNEL_MIN |
main/wifi_sniffer.h |
1 |
First channel to scan |
WIFI_CHANNEL_MAX |
main/wifi_sniffer.h |
13 |
Last channel to scan |
WIFI_CHANNEL_DWELL_MS |
main/wifi_sniffer.h |
200 |
ms per channel |
LED_DEFAULT_BRIGHTNESS |
main/led.h |
128 |
Brightness on first join (0–254) |