This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-CC2652RB: How to periodically report "Metering" and "On/Off" clusters' attributes

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: CC2652P,

Good morning, i'm struggling a bit on browsing the docs in order to understand a couple of things related to my custom project involving some LP-CC2652RB with custom firmware (zr_genericapp with "Smart Plug" clusters "Metering" and "On/Off") and a single CC2652P (coordinator) flashed with ZNP being hosted by Zigbee2mqtt software, which i am monitoring by its frontend.

With the right hints by Ryan, i have successfully set up the project, setting "On/Off" cluster's attributes callback and using it in order to control a LED on the Launchpad by sending the cluster commands "Toggle"/"On"/"Off" from the Zigbee2mqtt frontend.

Now i'm trying to make the next step that is reporting the "Metering" and "On/Off" cluster attributes in a periodic regime to the coordinator and to the Mqtt broker, in order to see the values in real-time on the frontend (which will be replaced in the future by a webapp that i have to design).

1 - How to implement this in the firmware? It is clear for me how to create and use callbacks to handle received commands related to a specific cluster, like i did for the On/Off cluster. But how to make attribute reports? How to report the values of the Metering and On/Off attributes? I'm a bit disoriented on finding these answers in the docs.

2 - If the async report is not possible, how to handle the problem in a ''polling'' way by the coordinator?

Thank you in advance, i'm having a lot of fun with these projects, but i'm often getting stuck in the docs browsing.

Roberto

  • You can send ZCL Configure Reporting Command to configure On/Off report. You can refer to section 2.5.7 Configure Reporting Command in ZCL spec.

  • Hello Roberto,

    To enable attribute reporting for the on/off attribute, please follow the light example.  This includes making the necessary changes inside zcl_samplelight.c and zcl_samplelight_data.c where BDB_REPORTING is considered.  You  need to make sure that the correct attribute records have ACCESS_REPORTABLE set and will also need to create a local bind on your light device using the extended address and endpoint destination of your ZNP.  This can either be achieved using the discovery feature of the UART terminal User Interface or by following the Zigbee Fundamentals SimpleLink Academy Lab.  Once you've established attribute reporting for the on/off attributes you should be able to replicate the implementation for the metering attributes as well.

    Regards,
    Ryan