Closed elgerg closed 3 months ago
Hello @elgerg,
I couldn't find the definition for an illuminance sensor in the Zigbee Home Automation specification. Did you mean a light sensor? If so, adding the structure is straightforward. You can follow the code below.
#define ESP_ZB_DEFAULT_LIGHT_SENSOR_CONFIG() \
{ \
.basic_cfg = \
{ \
.zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \
.power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \
}, \
.identify_cfg = \
{ \
.identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \
}, \
.illuminance_meas_cfg = \
{ \
.measured_value = ESP_ZB_ZCL_ILLUMINANCE_MEASUREMENT_LIGHT_SENSOR_TYPE_DEFAULT_VALUE, \
.min_value = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MIN_MEASURED_VALUE_MIN_VALUE, \
.max_value = ESP_ZB_ZCL_ATTR_ILLUMINANCE_MEASUREMENT_MAX_MEASURED_VALUE_MAX_VALUE, \
}, \
}
typedef struct esp_zb_light_sensor_cfg_s {
esp_zb_basic_cluster_cfg_t basic_cfg; /*!< Basic cluster configuration, @ref esp_zb_basic_cluster_cfg_s */
esp_zb_identify_cluster_cfg_t identify_cfg; /*!< Identify cluster configuration, @ref esp_zb_identify_cluster_cfg_s */
esp_zb_illuminance_meas_cluster_cfg_t illuminance_meas_cfg;
} esp_zb_light_sensor_cfg_t;
We also will consider adding it in next version.
Ah, my bad. I assume light sensor was illuminance based on this being in the header:
/**
* @brief Zigbee standard mandatory attribute for illuminance measurement cluster
*
*/
typedef struct esp_zb_illuminance_meas_cluster_cfg_s {
uint16_t measured_value; /*!< The attribute indicates the illuminance from 0x0000 to 0xffff */
uint16_t min_value; /*!< The attribute indicates minimum value of the measured value */
uint16_t max_value; /*!< The attribute indicates maximum value of the measured value */
} esp_zb_illuminance_meas_cluster_cfg_t;
So, to add your code do I need to edit my local version of esp_zigbee_type.h?
Sorry for the dumb questions, I'm trying to get this working under Arduino until the official wrapper is available.
Thanks in advance!
@elgerg ,
So, to add your code do I need to edit my local version of esp_zigbee_type.h?
I suggest adding the code to your local file. I'm concerned that adding it to esp_zigbee_type.h
in the IDF component might cause a compilation issue.
Hi @xieqinan, the light sensor is defined in Zigbee Home Automation specification as 0x0106. Can this be added please?
Found that on multiple places.
@P-R-O-C-H-Y ,
the light sensor is defined in Zigbee Home Automation specification as 0x0106. Can this be added please?
The Light Sensor Number will also be added in the next release. In the meantime, please add it to your local file.
@elgerg ,
This issue has been resolved in esp-zigbee-sdk v1.5.0. Please update to this version and test again.
Answers checklist.
IDF version.
n/a
esp-zigbee-lib version.
Current
esp-zboss-lib version.
Unknown, looking at the source in this repo
Espressif SoC revision.
ESP32-H2
What is the expected behavior?
I'd expect a illuminance section in esp_zigbee_type.h similar to:
What is the actual behavior?
Nothing, it's not there
Steps to reproduce.
open esp_zigbee_type.h and search for illuminance, there is only one section for attributes but not one for the cluster.
More Information.
No response