Zigbee Color temperature light
Posted: Fri Oct 20, 2023 5:23 pm
I am new to ESP-IDF and ESP-Zigbee SDK. I am trying to create a color-temperature-adjustable, dimmable light using ESP-IDF 5.1 on ESP32-H2. Specifically, I am trying to modify the HA Color Dimmable Light example to accept color temperature adjustment (MIRED) instead of RGB (x and y coordinates). I just want to successfully log the command and values message, am not worried about the hardware side at all yet. I have modified the color mode and color capabilities successfully so the device is correctly recognized as such by the controller. It joins the network, and I can control on/off and level fine. However, not so when I send a color temp value (cluster 0x300, attribute 0x0a) from the client controller. When my device receives this packet, the ESP32 immediately crashes and reboots. This happens before any interaction with my attribute handler or even the action handler, so this has nothing to do with the LED driver.
I believe the issue is with something specific to esp_zb_color_dimmable_light_ep_create(), and/or the color cluster configuration I am passing to it. Here's what it looks like:
.color_cfg = \
{ \
.current_x = ESP_ZB_ZCL_COLOR_CONTROL_CURRENT_X_DEF_VALUE, \
.current_y = ESP_ZB_ZCL_COLOR_CONTROL_CURRENT_Y_DEF_VALUE, \
.color_mode = 0x0002, \
.options = ESP_ZB_ZCL_COLOR_CONTROL_OPTIONS_DEFAULT_VALUE, \
.enhanced_color_mode = ESP_ZB_ZCL_COLOR_CONTROL_ENHANCED_COLOR_MODE_DEFAULT_VALUE, \
.color_capabilities = 0x0010, \
},
Because there is nothing that addresses anything to do with color temperature values in this config, I suspect the ESP Zigbee device or task is trying to write to an invalid address. As I said, I don't really want X and Y coordinate control at all, I only care about handling the command move_to_color_temperature (value in MIRED). But I don't know how to handle this in the color cluster configuration.
Has anyone successfully made a color temperature/dimmable light using ESP Zigbee SDK? Anything someone can tell me that might point me in the right direction is appreciated.
I believe the issue is with something specific to esp_zb_color_dimmable_light_ep_create(), and/or the color cluster configuration I am passing to it. Here's what it looks like:
.color_cfg = \
{ \
.current_x = ESP_ZB_ZCL_COLOR_CONTROL_CURRENT_X_DEF_VALUE, \
.current_y = ESP_ZB_ZCL_COLOR_CONTROL_CURRENT_Y_DEF_VALUE, \
.color_mode = 0x0002, \
.options = ESP_ZB_ZCL_COLOR_CONTROL_OPTIONS_DEFAULT_VALUE, \
.enhanced_color_mode = ESP_ZB_ZCL_COLOR_CONTROL_ENHANCED_COLOR_MODE_DEFAULT_VALUE, \
.color_capabilities = 0x0010, \
},
Because there is nothing that addresses anything to do with color temperature values in this config, I suspect the ESP Zigbee device or task is trying to write to an invalid address. As I said, I don't really want X and Y coordinate control at all, I only care about handling the command move_to_color_temperature (value in MIRED). But I don't know how to handle this in the color cluster configuration.
Has anyone successfully made a color temperature/dimmable light using ESP Zigbee SDK? Anything someone can tell me that might point me in the right direction is appreciated.