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.

Power configuration cluster - HA 1.2

Other Parts Discussed in Thread: Z-STACK

Hi,

I am using the HA 1.2 zstack (from TI website) for my applications.

However i need to use the "Power Configuration Cluster" for my end application as my devices will be battery powered.

From the HA1.2 stack , i am seeing that the code does not support power configuration cluster at all.

Can you anyone please suggest on how i can go ahead with implementing this cluster (power configuration)?

Thanks,

Sindhu

  • Hi,

    there are some examples to add new profiles in ZigBee Home Automation examples:

    http://processors.wiki.ti.com/index.php/Category:ZigBee_Home_Automation

  • 1. Put ZCL_CLUSTER_ID_GEN_POWER_CFG into your zclXXX_InClusterList

    2. Put ATTRID_POWER_CFG_BAT_ALARM_MASK/ZCL_CLUSTER_ID_GEN_POWER_CFG in your zclXXX_Attrs.

    3. Use zcl_SendReportCmd to send ZCL_CLUSTER_ID_GEN_POWER_CFG when low battery occurs.

  • Thanks for the suggestions.

    I will look at the examples and also the steps provided and get back if i need more clarifications.

  • Hi Leo!

         are you sure there is  some example  which using Power Configuration Cluster ?

         I sorry  i have  not found any example using  Power Configuration Cluster in your link 。

    BR

        

  • All those TI Z-Stack examples don't use Power Configuration Cluster. You have to do it by yourself.
  • Hi  Yikai ,

            thank  you for  your reply。

           follow your advice, i have do those step for  using Power Configuration Cluster to report battery low status.

           1.  Define a uint8 vaule for  save  the Battery  Alram Mask, and declare in ATTR list

                uint8 zclTest_BatteryAlarmMask = 0x00;

              

      ///*** Power Configuration Cluster ***********/
      {
        ZCL_CLUSTER_ID_GEN_POWER_CFG ,
        { // Attribute Alarm Mask
          ATTRID_POWER_CFG_BAT_ALARM_MASK,
          ZCL_DATATYPE_BITMAP8,
          (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
          (void *)&zclTest_BatteryAlarmMask
        }
      },

             2. Adding  ZCL_CLUSTER_ID_GEN_POWER_CFG cluster ID in Cluster List

            

    #define ZCLTest_MAX_INCLUSTERS       3
    const cId_t zclTest_InClusterList[ZCLTest_MAX_INCLUSTERS] =
    {
      ZCL_CLUSTER_ID_GEN_BASIC,
      ZCL_CLUSTER_ID_GEN_IDENTIFY,
      ZCL_CLUSTER_ID_GEN_POWER_CFG
    };

            3.  when  device detects battery low , it will sending a report

          

             /*******************Create the Battery Low report command*************/
             zclReportCmd_t *pBatLowReportCmd;
             pBatLowReportCmd = (zclReportCmd_t *)osal_mem_alloc( sizeof( zclReportCmd_t ) 
                                                  + ( 1 * sizeof( zclReport_t ) ) );
             if ( pBatLowReportCmd != NULL )
             {
               //only report one attr
               pBatLowReportCmd->numAttr = 1;
               // Set up the first attribute
               pBatLowReportCmd->attrList[0].attrID = ATTRID_POWER_CFG_BAT_ALARM_MASK;
               pBatLowReportCmd->attrList[0].dataType = ZCL_DATATYPE_BITMAP8;
               pBatLowReportCmd->attrList[0].attrData = BAT_ALARM_MASK_VOLT_2_LOW;
               //Send the report
               zcl_SendReportCmd( Test_ENDPOINT, &zclTest_DstAddr,
                               ZCL_CLUSTER_ID_GEN_POWER_CFG, pBatLowReportCmd,
                               ZCL_FRAME_SERVER_CLIENT_DIR, 1, 0 ); 
             }
             //release data
             osal_mem_free(pBatLowReportCmd);
            /*************end of sending battery low alarm report******************/

          4.  when  Battery  returns normal , it  wil  resend the report again ,and  that will set the attrData As 0x00;

    so  , do you think  is that enough for  checking the battery status of ZED?

    PS:

          I saw  the ZCL library provide a  lot  of attribute for POWER CONFIGURATION CLUSTER

         Mains Information, Mains Setting , Battery Information  , Battery  Setting.

         They also have  a lot of  rule, it was so complete, but  so complicated.

    BR!

  • Lots of them are optional so you don't have to implemented them. You can refer to Zigbee HA spec and ZCL spec for details.