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.