You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a two-key Green Power switch. I was able to connect it to my ESP32-C6 board, and I get reports ( esp_zb_core_action_handler_register ) when pressing the 1-key "ON", when pressing the 2-key "OFF". But I do not receive a report on the repeated key press. When using the esp_zb_raw_command_handler_register function, I see that the repeated data is received. How can I configure the code to receive repeated presses?
RAW Data:
cluster id: 0x6, command id: 1, dst_ep: 1, src_ep: 0 <--- There is a report on the switch
I (15154) RAW: bufid: 15 size: 0
cluster id: 0x6, command id: 0, dst_ep: 1, src_ep: 0 <--- There is a report on the switch
I (16904) RAW: bufid: 17 size: 0
cluster id: 0x6, command id: 0, dst_ep: 1, src_ep: 0 <--- This package does not appear in the esp_zb_core_action_handler_register(zb_action_handler) report;
Is it possible to set it to display all received events so that I can use each key separately?
Describe the solution you'd like.
No response
Describe alternatives you've considered.
At the moment the solution is only to analyze RAW data obtained using esp_zb_raw_command_handler_register...
Additional context.
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Add callback for resending the same command id value for cluster on_off
Add callback for resending the same command id value for cluster on_off (TZ-1526)
Feb 6, 2025
Is your feature request related to a problem?
I have a two-key Green Power switch. I was able to connect it to my ESP32-C6 board, and I get reports ( esp_zb_core_action_handler_register ) when pressing the 1-key "ON", when pressing the 2-key "OFF". But I do not receive a report on the repeated key press. When using the esp_zb_raw_command_handler_register function, I see that the repeated data is received. How can I configure the code to receive repeated presses?
`static esp_err_t zb_attribute_handler(const esp_zb_zcl_set_attr_value_message_t *message)
{
esp_err_t ret = ESP_OK;
bool light_state = 0;
ESP_RETURN_ON_FALSE(message, ESP_FAIL, "TAG", "Empty message");
ESP_RETURN_ON_FALSE(message->info.status == ESP_ZB_ZCL_STATUS_SUCCESS, ESP_ERR_INVALID_ARG, "TAG", "Received message: error status(%d)",
message->info.status);
LOG(ESP_LOG_INFO, "Received message: endpoint(%d), cluster(0x%x), attribute(0x%x), data size(%d)", message->info.dst_endpoint, message->info.cluster,
message->attribute.id, message->attribute.data.size);
if (message->info.dst_endpoint == HA_LIGHT_ENDPOINT) {
if (message->info.cluster == ESP_ZB_ZCL_CLUSTER_ID_ON_OFF) {
if (message->attribute.id == ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_BOOL) {
light_state = message->attribute.data.value ? *(bool *)message->attribute.data.value : light_state;
LOG(ESP_LOG_INFO, "Light sets to %s", light_state ? "On" : "Off");
}
}
}
return ret;
}
static esp_err_t zb_action_handler(esp_zb_core_action_callback_id_t callback_id, const void *message)
{
esp_err_t ret = ESP_OK;
switch (callback_id) {
case ESP_ZB_CORE_SET_ATTR_VALUE_CB_ID:
ret = zb_attribute_handler((esp_zb_zcl_set_attr_value_message_t *)message);
break;
default:
LOG(ESP_LOG_WARN, "Receive Zigbee action(0x%x) callback", callback_id);
break;
}
return ret;
}
static void esp_zb_task(void *pvParameters)
{
esp_zb_cfg_t zb_nwk_cfg = {
.esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR,
.install_code_policy = INSTALLCODE_POLICY_ENABLE,
.nwk_cfg.zczr_cfg = {
.max_children = MAX_CHILDREN,
},
};
esp_zb_init(&zb_nwk_cfg);
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);
}`
RAW Data:
cluster id: 0x6, command id: 1, dst_ep: 1, src_ep: 0 <--- There is a report on the switch
I (15154) RAW: bufid: 15 size: 0
cluster id: 0x6, command id: 0, dst_ep: 1, src_ep: 0 <--- There is a report on the switch
I (16904) RAW: bufid: 17 size: 0
cluster id: 0x6, command id: 0, dst_ep: 1, src_ep: 0 <--- This package does not appear in the esp_zb_core_action_handler_register(zb_action_handler) report;
Is it possible to set it to display all received events so that I can use each key separately?
Describe the solution you'd like.
No response
Describe alternatives you've considered.
At the moment the solution is only to analyze RAW data obtained using esp_zb_raw_command_handler_register...
Additional context.
No response
The text was updated successfully, but these errors were encountered: