-
Notifications
You must be signed in to change notification settings - Fork 41
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
How is esp_zb_identify_notify_handler_register intended to be used? (TZ-1515) #549
Labels
Comments
Hi, To verify your issue, I have added the following patch to the esp-zigbee-sdk, and the light example works fine with Home Assistant. Could you please point out the differences in your application? diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c
index a402971..47b5c58 100644
--- a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c
+++ b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c
@@ -124,6 +124,11 @@ static esp_err_t zb_action_handler(esp_zb_core_action_callback_id_t callback_id,
return ret;
}
+static void zb_identify_notify_handler(uint8_t identify_on)
+{
+ printf("identify: %d\n", identify_on);
+}
+
static void esp_zb_task(void *pvParameters)
{
/* initialize Zigbee stack */
@@ -139,6 +144,7 @@ static void esp_zb_task(void *pvParameters)
esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_on_off_light_ep, HA_ESP_LIGHT_ENDPOINT, &info);
esp_zb_device_register(esp_zb_on_off_light_ep);
esp_zb_core_action_handler_register(zb_action_handler);
+ esp_zb_identify_notify_handler_register(HA_ESP_LIGHT_ENDPOINT, zb_identify_notify_handler);
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);
ESP_ERROR_CHECK(esp_zb_start(false));
esp_zb_stack_main_loop(); The log would be like:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question
Finding
esp_zb_identify_notify_handler_register
in the API I figured registering a callback would automatically route identify commands for the endpoint to the callback. But this doesn't seem to be the case.With only a handler registered with
esp_zb_core_action_handler_register
I receive aESP_ZB_CORE_SET_ATTR_VALUE_CB_ID
command ID at the action handler. However, this only happens on the first 'boot' of the ESP.When I register a callback with
esp_zb_raw_command_handler_register
, the identify command is seen on every request. The command ID and payload is as expected. If I returnfalse
from this callback (unhandled) the command appears to be then routed to the callback registered inesp_zb_core_action_handler_register
- but again only on the first identify request for that boot.If I call
zb_zcl_send_default_handler
and returntrue
from my raw command handler, the core handler is not called. This is expected behavior for core, but hoped it would call my endpoint specific callback fromesp_zb_identify_notify_handler_register
.Additional context.
Sending ID commands from homeassistant. Commands appear to be well formed coming out of home assistant and received at the raw command handler.
Trying to get IDs to work on an EP specific basis without writing endpoint specific code into my core action handler.
***edits - clarity.
The text was updated successfully, but these errors were encountered: