Update the Status of a Zigbee Light

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

Update the Status of a Zigbee Light

Postby 0xDEADBEEF » Wed Jul 24, 2024 9:14 pm

Hello,

I have a working dimmable light that I can control fine using zigbee2mqtt. However my device has a button, and I've configured the button so it can turn the light on and off.

I'm having trouble finding the right API calls in the documentation on how I would properly update the Zigbee network about the changed light status.

I have tried modifying the example code from the temperature sensor and just exchange endpoint and cluster, but this does not seem to work:

Code: Select all

    esp_zb_lock_acquire(portMAX_DELAY);
    esp_zb_zcl_set_attribute_val(HA_COLOR_DIMMABLE_LIGHT_ENDPOINT,
    ESP_ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
    ESP_ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID, &light_level, false);
    esp_zb_zcl_set_attribute_val(HA_COLOR_DIMMABLE_LIGHT_ENDPOINT,
    ESP_ZB_ZCL_CLUSTER_ID_ON_OFF, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
    ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID, &light_state, false);
    esp_zb_lock_release();
What would be the proper way to update the zigbee network on the updated state of my device? It's only about the level control and the on_off clusters.

thank you!

Jjjjjj
Posts: 1
Joined: Thu Aug 22, 2024 11:32 pm

Re: Update the Status of a Zigbee Light

Postby Jjjjjj » Thu Aug 22, 2024 11:40 pm

Hi, i am having the exact same Problem. Did you get it working, and would you mind sharing your Code?

Who is online

Users browsing this forum: No registered users and 46 guests