Hi There!
I'm using the dimmable light bulb example and have extended it with the color control attribute list. I'm using the zb_zcl_color_control_attrs_ext_t in combination with ZB_ZCL_DECLARE_COLOR_CONTROL_ATTRIB_LIST to be able to use the current x and y values.
ZB_ZCL_DECLARE_COLOR_CONTROL_ATTRIB_LIST( color_control_attr_list, &dev_ctx.color_control_attr.set_color_info.current_X, &dev_ctx.color_control_attr.set_color_info.current_Y); ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST( dimmable_light_clusters, basic_attr_list, identify_client_attr_list, identify_server_attr_list, groups_attr_list, scenes_attr_list, on_off_attr_list, level_control_attr_list, color_control_attr_list);
I assumed I would be able to interface the color control cluster the same way as the level control cluster. That, however, doesn't seem the case. There is no device callback ID for the color control cluster, like there is for the level control cluster (ZB_ZCL_LEVEL_CONTROL_SET_VALUE_CB_ID) and checking for set attribute value callbacks (like underneath) also doesn't work; no such event occurs.
case ZB_ZCL_SET_ATTR_VALUE_CB_ID: { zb_uint8_t cluster_id = p_device_cb_param->cb_param. set_attr_value_param.cluster_id; zb_uint8_t attr_id = p_device_cb_param->cb_param. set_attr_value_param.attr_id; if (cluster_id == ZB_ZCL_CLUSTER_ID_ON_OFF) { uint8_t value = p_device_cb_param->cb_param.set_attr_value_param .values.data8; LOG_INF("on/off attribute setting to %hd", value); if (attr_id == ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID) { light_bulb_set_brightness(value ? 100 : 0); } } else if (cluster_id == ZB_ZCL_CLUSTER_ID_COLOR_CONTROL){ const zb_uint16_t value = p_device_cb_param->cb_param.set_attr_value_param.values.data16; if(attr_id == ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_X_ID){ LOG_INF("Received new X %hd", value); } else if (attr_id == ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_Y_ID){ LOG_INF("Received new Y %hd", value); } else { LOG_WRN("Unused color attribute! %hd.", value); } } break; }
I assume this is something that's currently not supported? I also think it's weird that the level control is handled over here at line 447, but also at line 471... Per my experience, only line 447 is triggered (I can remove the code at line 471). Such an callback ID not being present for the color control, appears to be the cause of my problem. I expect a ZB_ZCL_COLOR_CONTROL_SET_VALUE_CB_ID, but there is no such macro.
What also could be a pointer in the right direction, is that there's a ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX in the ZB_DECLARE_DIMMABLE_LIGHT_EP macro, but there's no such thing as ZBOSS_DEVICE_DECLARE_COLOR_CONTROL_CTX..
Kind regards,
Jochem