Creating Zigbee gadgets

Good evening everyone,

Everything is in the title :sweat_smile: So far, I’ve been used to tinkering with my Wi-Fi integrations using RPi0W, but it quickly becomes limiting and I think it’s no longer the right method… So, I’m wondering about developing Zigbee gadgets with ESP. Not being a specialist in embedded systems at all, I was wondering if anyone might have good leads to learn or sources to share? The ideas for gadgets are quite basic for now: replacing a distance probe to start with, we’ll see after that!

Looking forward to exchanging with the motivated ones!

Have a nice evening,

Jean

Hello Jean!

Good news regarding your February topic: ESPHome has natively integrated Zigbee since version 2026.5. This changes a lot for your case, as you no longer need to write C with the Espressif ESP-Zigbee-SDK. You describe your sensor in YAML and ESPHome handles the Zigbee stack.

The documentation is here: Zigbee Component - ESPHome - Smart Home Made Simple

Concretely for your distance probe:

Hardware: Prefer the ESP32-H2. It doesn’t have Wi-Fi, but the ESPHome documentation explicitly states that it is more reliable than the C6 in Zigbee (there are reports of C6 cards that only work next to the coordinator). The C5 and C6 are also supported.

Sensor: Everything that already exists as an ESPHome component works. JSN-SR04T or A02YYUW if it’s in a humid environment, VL53L0X in time-of-flight if you’re dealing with short distances.

Configuration: You add a zigbee: block and your classic sensor:. The sensors are exposed in the « analog input » cluster with the unit of measurement, so your distance is directly sent to Zigbee2MQTT without needing to write a custom converter.

Two constraints to be aware of:

  • You need Zigbee2MQTT version 2.8.0 minimum (this is fine on the Gladys side)
  • For every configuration change (adding or removing an entity, changing a name), you need to remove the device from the network, re-pair it, and restart the interview in Z2M. Otherwise, you’ll have inconsistent behavior, or even boot loops.

The remaining challenge is battery life: on ESP32, you need to use deep sleep with Zigbee re-association on wake-up, and development boards consume much more than bare modules. If battery life is really critical, ESPHome also supports the nRF52, which are better suited for this.

If you still prefer to do low-level work, the reference remains the ESP-Zigbee-SDK: GitHub - espressif/esp-zigbee-sdk: Espressif Zigbee SDK · GitHub

On the Gladys side: Once the device is paired in Z2M, it should appear in the Zigbee2MQTT integration like any other sensor. These generic devices are not always perfectly typed, so if the value is not displayed correctly, post the MQTT payload here and I’ll see what needs to be adjusted.

Hello!

I haven’t had a chance to test it yet, but just to let you know, the Tasmota project has natively supported ZigBee for quite some time…

Good evening @pierre-gilles :slight_smile:

Thanks for these leads. And, happy coincidence, I’m using the exact hardware described: ESP32-H2 SuperMini coupled with an AJ-SR04M sensor!

I had already tested using ESPHome, but failed to install the firmware… And on the forum, I was given to understand that it’s not necessarily supported. Abandoning this path in favor of the ESP-IDF SDK, which is well managed by Claude. I’m making progress little by little…

If I manage to get this ESP32 working, I think I’ll use it as a basis for several other modules: rain gauge, anemometer, UV meter, flow meter, etc…

I’ll get back to you when I’ve made progress to share my solutions :heart_hands:

Have a great evening,

Jean

Good evening @GBoulvin,

Thanks for your idea, but I can’t find the ESP32-H2 in the list of compatible devices :-:thinking: I looked up references here: ESP32 Based Devices

Do you have any other ideas?

Have a nice evening too,

Jean