Newbee questions to start using ESP-IDF for Zigbee

wifitier
Posts: 4
Joined: Fri Oct 19, 2018 9:18 am

Newbee questions to start using ESP-IDF for Zigbee

Postby wifitier » Sat Dec 06, 2025 8:04 pm

Hi! I've started coding using VS Code with Espressif-IDF (5.5) SDK and want to write firmwares for ESP32-H2 based Zigbee End Devices (ZED). I have a Zigbee mesh at home (Home Assistant, using Z2M).
Can somebody lead me through the necessary steps? I've read fragments about clusters and endpoint etc. but i'm not shure what to use in which order and which SDK commands? I really like to learn this suff buttom up and so i would be very happy for some explanations.

As an example i'd like to create a firmware for an device implementing an on/off/dim function for a 1-color LED strip.

lichurbagan
Posts: 59
Joined: Thu Nov 13, 2025 3:20 pm

Re: Newbee questions to start using ESP-IDF for Zigbee

Postby lichurbagan » Sat Dec 13, 2025 5:45 pm

To build a Zigbee end device firmware on ESP32-H2, you must first learn the Zigbee object hierarchy. A device has endpoints, endpoints host clusters, clusters expose attributes and commands. For a dimmer light, you need the Basic, Identify, On/Off, and Level Control clusters on one endpoint. In ESP-IDF 5.5 you enable Zigbee in menuconfig, then define your endpoint and clusters in code using the esp_zigbee APIs. Register a callback to handle On/Off and Level commands and map those to your LED GPIO and PWM. Use `esp_zb_init`, register your endpoint, attach your callback, then start the Zigbee main loop. Permit joining in Zigbee2MQTT so your device joins your Home Assistant mesh. Clusters must match standard IDs so Z2M recognizes your dimmer correctly. Debug with verbose logging and check that your device advertises the correct HA device type. For hardware reference and inspiration on modular home automation devices, you can look at a community project like the Universal Smart Home Modular Hub on PCBWay, which includes schematics and PCB files that help you understand board design and integration with wireless controllers:

*spam*

Once your basic firmware works, add attribute reporting, OTA support, and power management. This stepwise understanding helps you write maintainable, standard Zigbee code rather than just copying examples.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Newbee questions to start using ESP-IDF for Zigbee

Postby nopnop2002 » Tue Dec 16, 2025 11:25 am

ESP32C6 Zigbee Quick Start Guide.
Probably the same for ESP32H2.

https://wiki.seeedstudio.com/xiao_esp32c6_zigbee/

Who is online

Users browsing this forum: Baidu [Spider], meta-externalagent, PetalBot and 9 guests