feat(zigbee): Add Illuminance sensor endpoint by MikaFromTheRoof · Pull Request #11171 · espressif/arduino-esp32 (original) (raw)

Description of Change

I added a new light sensor endpoint for the zigbee library.
I already informed P-R-O-C-H-Y that I will be creating a pull request for this.

Tests scenarios

I have tested my Pull Request on Arduino-esp32 core v3.2.0-RC2 with a ESP32-C6 board (DFRobot Beetle ESP32-C6) and with Home Assistant and Zigbee2MQTT plugin. The tested code example is part of the pull request.

Formular for calculating lux from raw illuminance

Please check the formular for calculating the lux value from raw illuminance. Typically it should be 10^(lsens_value/10000)-1 as I found on an issue regarding Zigbee2MQTT (see link below). Strangely enough for me testing the code with Zigbee2MQTT, the plugin seems to rather calculate the lux value with 10^(lsens_value/10000), so without the "-1" at the end...

New macro for default light sensor config

I added a new macro for the default light sensor config at the beginning of ZigbeeLightSensor.h. This works as it is, but the macro rather be added to esp-zigbee-sdk/components/esp-zigbee-lib/include/ha/esp_zigbee_ha_standard.h if possible

Source for lux calculation formular