Connecting Multiple Zigbee Thermometers/Hygrometers to an ESP32-C6

Hello,

I would like to connect multiple Zigbee thermometers/hygrometers to an ESP32-C6 and read their values directly from the ESP. These are generic Zigbee thermometers/hygrometers that work perfectly with a Tuya Zigbee hub, for example.

I found an example code in the documentation:
:link: Zigbee Thermostat Example

The code itself runs fine. If I connect a single thermometer to the ESP, I can successfully retrieve its temperature. However, I’m unable to connect multiple devices.

I tried creating another ZigbeeThermostat-type endpoint in the code, but when one of my thermometers/hygrometers connects, it seems to attach to both endpoints simultaneously. As a result, I get the same temperature value displayed twice (essentially duplicating the data from the same device).

If I then try to connect my second thermometer/hygrometer, it appears to establish a connection with the ESP (its LED stops blinking), but nothing changes—I still see the same duplicated temperature value from the first device. Additionally, I cannot retrieve any humidity readings at all.

I've searched extensively but haven’t found any relevant topics, example code, or solutions addressing these issues.

Could someone please help me?

Thank you! :blush:

Hi, firstly I am sorry but I don't think I can help you with your question as I am just beginning with trying to get a Zigbee device going,
BUT as you say that you have got your devices working, you might be able to help me...
My simple understanding of Zigbee devices is that you have to put them into "pairing mode" in order to connect them to your Zigbee network but I see no evidence of this in any of the Zigbee Library examples. They seem to just assume that they connect to a Zigbee coordinator.
My details are, I have an XIAO ESP32C6 board and I have loaded the Zigbee_On_Off_Light example to it, hoping that I can get it to appear in my Zigbee Network that is running as part of Home Assistant.

If you have any advice about how an example like your "thermostat" or my "light" is paired into a network I would be most grateful.

regards
PhilipJ

Hi,
Zigbee codes on ESP32-(H2 or C6) enter automatically in pairing mode during boot. They print in the terminal "Connecting ...", which means they are in pairing mode. It's the period where you can connect them to your coordinator. Just don't forget to put the Zigbee mode in Zigbee End-Device (in Tools section of Arduino IDE).
Best regards.
Damien

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.