Closed jkano closed 1 month ago
For time being, setting manufacturer code is not supported. Don't set the access of the attribute to ESP_ZB_ZCL_ATTR_MANUF_SPEC
when creating the custom attribute:
esp_zb_custom_cluster_add_custom_attr(custom_cluster, attr_id,
ESP_ZB_ZCL_ATTR_TYPE_U32,
ESP_ZB_ZCL_ATTR_ACCESS_READ_WRITE,
attr_value);
Hi. Thanks for the response.
The workaround works but it will not comply with Zigbee Spec.
Question
Hi,
I'm working on an application which has the OnOff cluster and a Custom Cluster (Manufacturer Specific) based on the example on how to create custom clusters: https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32/user-guide/zcl_custom.html
In my code, I create an endpoint list on endpoint 1, add mandatory clusters (Basic, Identify), add the OnOff cluster and then I add a custom cluster (0xFF02) with one custom attribute (0x0000, with a custom value of 10):
When I join this device to the network I can see the custom cluster (with a simple descriptor request) and the custom attribute (with a discover attributes request).
I can read the OnOff cluster OnOff attribute without any issues, but when I send a read attribute request to the custom cluster (0xFF02) with manufacturer specific flag set and manuf. code 0x1075, the device receives it but it can't read the attribute value.
So I added the
esp_zb_raw_command_handler_register(zb_raw_cmd_handler);
to do intercept (but not really) the zcl messages coming to the device so I can print the data there:This is my
zb_raw_cmd_handler
function:As you can see there, I print all the data about the received command and also if the command is a Read Attribute Request, I search the cluster attribute and print the data found in the cluster descriptor. Finally I try to get the attribute value using
esp_zb_zcl_get_attribute()
andesp_zb_zcl_get_manufacturer_attribute()
.There are the logs when I run the application:
As you can see, the first request is fine, both
esp_zb_zcl_get_attribute
andesp_zb_zcl_get_manufacturer_attribute
are returning the attribute value.But on the second one, as you can see, in the cluster descriptor the manuf. code is 0x0000 and for each attribute on that cluster the manuf. code is 0xffff. I think this is why neither
esp_zb_zcl_get_attribute
andesp_zb_zcl_get_manufacturer_attribute
are working to get the attribute value.Also, the response for the Read Attribute Request is code 0x86 (ESP_ZB_ZCL_STATUS_UNSUP_ATTRIB).
I dont see where to set the manuf. code for the cluster and attributes and I'm not sure if this is why the
esp_zb_zcl_get_manufacturer_attribute
are not working correctly.So my question is, what do I have to do for this custom clusters to work correctly? Read/Write attribute, Reporting, and cluster commands.
Thanks!
Additional context.
No response