Use a ESP 32 C6 for reading values from a Zigbee sensor and display values on a webpage or store in non volatile memory

HansVanSteen
Posts: 1
Joined: Fri Nov 21, 2025 4:52 pm

Use a ESP 32 C6 for reading values from a Zigbee sensor and display values on a webpage or store in non volatile memory

Postby HansVanSteen » Fri Nov 21, 2025 9:05 pm

As a bit of of a newbee at Zigbee programming I want to read a xiaomi zigbee humidity sensor and store the values in a non volatile memory.
Maybe display as a graph on a webpage.
Should i build a coordinator, does that allow me to store the value? No clue. Build a zigbee2mqtt?
Could someone help me with sw architecture and maybe some example code?
Regards

Hans

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

Re: Use a ESP 32 C6 for reading values from a Zigbee sensor and display values on a webpage or store in non volatile mem

Postby lichurbagan » Tue Nov 25, 2025 5:30 pm

You can read a Xiaomi Zigbee humidity sensor without building your own coordinator. Use Zigbee2MQTT instead. It handles pairing, decoding, and Xiaomi quirks. A simple Zigbee USB stick is enough. You then receive clean MQTT data. You store values locally. You display a graph on a small webpage.

This approach keeps things simple. Zigbee coding is hard. Xiaomi uses custom frames. Zigbee2MQTT hides all of that. You only write code for MQTT. Many projects follow this pattern. One good example is the Zigbee multi-sensor here:

https://www.pcbway.com/project/sharepro ... ensor.html

Your flow becomes easy. Zigbee2MQTT reads the sensor. It publishes humidity to MQTT. Your device subscribes to that topic. You save the value in flash or SD. You serve a web page from the device. The page loads stored values. A JavaScript chart draws the graph.

You can use an ESP32. It connects to WiFi. It connects to MQTT. It stores values in LittleFS. It serves a basic HTML page. Chart.js draws the data.

This setup is reliable. It is cheap. It scales well. Add more sensors later. Everything still works. Let me know if you want sample code.

Who is online

Users browsing this forum: Bing [Bot] and 12 guests