Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Cluster write Callback (TZ-114) #22

Closed
diazmanuel opened this issue May 12, 2023 · 10 comments
Closed

Custom Cluster write Callback (TZ-114) #22

diazmanuel opened this issue May 12, 2023 · 10 comments

Comments

@diazmanuel
Copy link

diazmanuel commented May 12, 2023

Hello!

I am trying to add a callback when an attribute of a custom cluster is modified
the custom cluster is created correctly and I can modify its attributes with another zigbee device but the callback is not called and returns the following message:

ESP_ZIGBEE_CORE: cluster ID:65534, attribute ID:0 is currently not supported for updating!

iam ussing the master sdk.
This means that the sdk does not support the callback for custom clusters, is there a solution to this?

I am registering the callback as follows:

void attr_cb(uint8_t status, uint8_t endpoint, uint16_t cluster_id, uint16_t attr_id, void *value)
{
ESP_LOGI(TAG,"Callback");
}
static void esp_zb_task(void *pvParameters)
{
esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZED_CONFIG();
esp_zb_init(&zb_nwk_cfg);

uint32_t FFFE_flag=5;
uint16_t FFFE_away;
uint16_t FFFE_hum;
uint16_t FFFE_bat;
uint8_t FFFE_crono[200];

esp_zb_attribute_list_t *FFFE = esp_zb_zcl_attr_list_create(0xFFFE);
esp_zb_custom_cluster_add_custom_attr(FFFE, 0x00, 0x23, 0x07,&FFFE_flag);
esp_zb_custom_cluster_add_custom_attr(FFFE, 0x01, 0x29, 0x07,&FFFE_away);
esp_zb_custom_cluster_add_custom_attr(FFFE, 0x02, 0x29, 0x05,&FFFE_hum);
esp_zb_custom_cluster_add_custom_attr(FFFE, 0x03, 0x29, 0x05,&FFFE_bat);
esp_zb_custom_cluster_add_custom_attr(FFFE, 0x04, 0x42, 0x06,FFFE_crono);

esp_zb_cluster_list_t *esp_zb_cluster_list = esp_zb_zcl_cluster_list_create();
esp_zb_cluster_list_add_custom_cluster(esp_zb_cluster_list, FFFE, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
esp_zb_device_add_set_attr_value_cb(attr_cb);

esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);
ESP_ERROR_CHECK(esp_zb_start(false));
esp_zb_main_loop_iteration();

}

@github-actions github-actions bot changed the title Custom Cluster write Callback Custom Cluster write Callback (TZ-114) May 12, 2023
@likunqiao097304
Copy link
Contributor

@diazmanuel The attribute callback are now only supported changes from ON/OFF, LEVEL, COLOR attribute change, not the customized attribute callback. For the customized cluster related, we supported custom cluster command callback, read attribute callback. We will support your need in the future release.

@diazmanuel
Copy link
Author

@diazmanuel The attribute callback are now only supported changes from ON/OFF, LEVEL, COLOR attribute change, not the customized attribute callback. For the customized cluster related, we supported custom cluster command callback, read attribute callback. We will support your need in the future release.

Thanks for the answer. I would like to know when you plan to support this functionality since it seems to be something simple, the sdk already correctly identifies the cluster and the attribute, it also allows you to modify it and the warning that it launches is executed when the attribute is edited, so the only thing that would be missing is to enable the call to the callback function

@chshu
Copy link
Collaborator

chshu commented May 26, 2023

@diazmanuel The issue has been fixed in latest main branch, please try it out, thanks for reporting the issue.

@diazmanuel
Copy link
Author

@diazmanuel The issue has been fixed in latest main branch, please try it out, thanks for reporting the issue.

hello, i try using the custom cluster write callback again and still doesnt works i get the same message :

W (236902) ESP_ZIGBEE_CORE: cluster ID:65534, attribute ID:0 is currently not supported for updating!

I am also sure that I am using the latest version since another change that you request (issue (TZ-117) #23 ) works correctly

@abdulrehmanee12
Copy link
Contributor

hi @diazmanuel for a quick fix you need to use esp_zb_add_custom_cluster_command_cb(HA_ESP_LIGHT_ENDPOINT, ESP_ZB_ZCL_CLUSTER_ID_CUSTOM, NULL); in your example code to register custom cluster id as in our internal implementation we are currently using custom_cluster_command_cb to register custom cluster id . Later we can workaround to change it.

@likunqiao097304
Copy link
Contributor

@diazmanuel Hi, the latest release has been fixed the recently error you faced, please try it out.

@diazmanuel
Copy link
Author

@likunqiao097304 Perfect, now it works correctly

@diazmanuel
Copy link
Author

hello @likunqiao097304 , I still have problems with this callback, when using the signed data type 16 (0x29) it informs me that it does not support that data type, I tried it with unsigned 32 and it works correctly (0x23)

@abdulrehmanee12
Copy link
Contributor

abdulrehmanee12 commented Jul 21, 2023

@diazmanuel Currently , only u8, u16, u32 data types are supported for custom cluster write attr callback.

@Bosemani
Copy link

Hai @diazmanuel
I'm also getting same error like yours "W (236902) ESP_ZIGBEE_CORE: cluster ID:65534, attribute ID:0 is currently not supported for updating!"
Which version this bug is rectified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants