ESPHome example of a zigbee sensor.
Note that the Zigbee part in this project is currently hardcoded and included as a custom component including a task. (Changing this to an external component with more configuration possibilities would be the next step).
ESPHome Zigbee sensor connected to AHT10 Temperature+Humidity Sensor.
- One development board with ESP32-H2 SoC acting as Zigbee end-device (that you will load ESPHome with the zb-sensor config to).
- For example the official ESP32-H2-DevKitM-1 development kit board.
- AHT10/AHT20/AHT30 Temperature+Humidity Sensor connected to I2C pins (SDA: 12, SCL: 22).
- A USB cable for power supply and programming.
- (Optional) A USB-C cable to get ESP32 logs from the UART USB port (UART0).
- We will build ZB_sensor.yaml file.
- Check Getting Started with the ESPHome Command Line tutorial to setup your dev environment.
Steps
- Change the AHTx0 variant in ZB_sensor.yaml file according to the sensor you have
- Build with
esphome run ZB_sensor.yaml
command will fail - Copy idf_component.yml to
.esphome/build/zb-sensor/src/
- Add the following 4 lines to the
.esphome/build/zb-sensor/sdkconfig.zb-sensor
file
CONFIG_ZB_ENABLED=y
CONFIG_ZB_RADIO_NATIVE=y
CONFIG_ZB_ZED=y
ZB_ED_ROLE=y
- Build with
esphome run ZB_sensor.yaml
command - Firmware will be uploaded automatically to the ESP32-H2 board
- There is a bug in ESPHome 2024.3.0. Deactivate the logger to make it build.
- Check issue 2024.3.0 fails to compile in logger component #5612.
- This should be fixed by esphome/esphome#6323 which should be included in ESPHome 2024.3.1.
- If library versions in idf_component.yml are changed, copy the file to
.esphome/build/zb-sensor/src/
again and delete.esphome/build/zb-sensor/.pioenvs
.
Note! The official documentation and reference examples for the ESP Zigbee SDK can currently be obtained from Espressif:
If looking to contribute to this project then suggest follow steps in these guides + look at issues in Espressif's ESP Zigbee SDK repoository: