This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Alarms Cluster workflow, ZigBee

I would like to know, what is the correct workflow with Alarms ZCL cluster?

There are no examples with it in SDK (at least, as I have seen). The documentation on this subject is extremely concise, just lists the types, functions, etc. It doesn’t explain, which actions I need to do for myself (some callbacks?), and which part the ZigBee stack will manage?

So, it is entirely unclear for me, how to use it.

Particularly, I am interested in using Alarms with Electrical Measurement cluster, i.e., to alarm about the voltage outbound the safe region, for example. How could I set up and use it?

Parents
  • Hi again.

    You have to include the Alarm cluter and Electrical Measurement cluster like you would do in any other project.

    And when ever you like to "use the alarm", just use the function

    ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ

    Which you find in external\zboss\include\zcl\zb_zcl_alarms.h

    There is also coming a new SDK in a few week with some good bug fixes for the Alarm cluster.

    Best regards,

    Andreas

  • Hi, Andreas.

    Thank you for the information.

    The correct algorithm to use the Alarms cluster is still unclear for me.

    The declared attributes of Alarms cluster include an alarm table. How can I fill it? Or I need just to declare an appropriate variable (array of structures?) and provide while cluster declaration, so the Zigbee stack will manage it?

    So, imagine that I need to alarm about AC Voltage Overload. In this case, I need to:

    1) include the Alarm cluster and Electrical Measurement cluster

    2) set (via zb_zcl_set_attr_val function?) corresponding bit in ACAlarmsMask attribute of Electrical Measurement cluster

    3) set ACVoltageOverload threshold attribute of Electrical Measurement cluster

    4) periodically check the RMSVoltage and report it by zb_zcl_set_attr_val function.

    But what I need to do next? Manually check, if RMSVoltage is over the threshold and call the ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ in this case?

    I supposed, that this situation should be managed by Zigbee stack, as I set the threshold and periodically updating the attribute value?

    And what about the alarm table?

    There is also coming a new SDK in a few week with some good bug fixes for the Alarm cluster.

    Could you please comment on it, how these bugs critical? It is better to not use the Alarm cluster now at all, or I can use it with some restrictions?

    Sincerely,

    Anna

  • Hi.

    There is unfortunately not any logic implemented for this on our side, and looking at the specification it seems you have to implement this yourself.

    So you have to implement something like this:

    You read the attribute value. You then compare the read value with the measured value. If it excees whatever limit you send then construct the alarm frame and send it.

    You just have to follow the information found in the Zigbee Cluster Library Specification (Cluster Library 07-5123 Revision 7) chapter 4.9.

    Issue that is fixed in the upcoming SDK: You can't use the ZCL Reset All Alarms command, if you do, then the device shall halt.

    Best regards,

    Andreas

Reply
  • Hi.

    There is unfortunately not any logic implemented for this on our side, and looking at the specification it seems you have to implement this yourself.

    So you have to implement something like this:

    You read the attribute value. You then compare the read value with the measured value. If it excees whatever limit you send then construct the alarm frame and send it.

    You just have to follow the information found in the Zigbee Cluster Library Specification (Cluster Library 07-5123 Revision 7) chapter 4.9.

    Issue that is fixed in the upcoming SDK: You can't use the ZCL Reset All Alarms command, if you do, then the device shall halt.

    Best regards,

    Andreas

Children
  • Hi.

    Thanks for the reply.

    Oh, I read the ZCL specification many times :) but revision 6, that is accessible from ZigBee Alliance site for non-members. Hope, chapter 4.9 not changed much, though.

    The Alarm-related attributes of Electrical Measurement cluster are all server-side and read-only (except the alarm mask, that can be as read and written by client). So, there is no externally changeable alarm threshold values for the device. A client can just set, which alarms are enabled (by writing the mask attribute), but not the threshold values for the alarms. That is why I thought, that the Zigbee stack will monitor and compare this attributes’ values (original attribute and threshold attribute) “automatically”, and update the alarms logging table in case of an alarm.

    So, as I understood correctly, with the current SDK, I can only use the  ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ when I manually detected the alarm situation?

    And, if I need the Alarms table (to store alarm events for demand), I need to manage it also manually, does it correct? I mean the functions described in sub-chapter 3.11.2.3 of ZCL specification (07-5123 Rev. 6).

    Sincerely,

    Anna

  • Hi Anna.

    You can use ZB_ZCL_ALARMS_SEND_RESET_ALARM_REQ manually when detecting the alarm situation.

    Alarm tables are actually handled automatically. You pass the name of them to the ZB_ZCL_DECLARE_ALARMS_ATTRIB_LIST define (look at its definition in zb_zcl_alarms.h). Take a look at zcl_alarms_commands.c  where the function that iterates over them is (when you clear an alarm). So they are handled automatically, so if you need to get them, out of ZB_ZCL_DECLARE_ALARMS_ATTRIB_LIST, you can see how they are called, these tables.

     Best regards,

    Andreas

  • Hi, Andreas.

    Thank you for your reply. 

    Unfortunately, I have no access to the ZBOSS source files (besides the headers), because the SDK provides the precompiled ZBOSS stack (libzboss files). So, I cannot see the functions' realization, (particularly zcl_alarms_commands.c), just their declarations in header files.

    Sincerely,

    Anna

     

Related