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

zigbee power config cluster

Hi,

  1. ZigBee Cluster Library Specification(Rev 6) -> 3.3.2.2.3  Battery Information Attribute Set  -> Table 3-18. Attributes of the Battery Information Attribute Set  tell me the BatteryVoltage attribute access is "Read only",  and the BatteryPercentageRemaining attribute access is "Read Only" & "Reportable".

But there is a define "ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID" on zb_zcl_power_config.h indicate that the BatteryVoltage attribute access support "Reportable". 

The define  "ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_REMAINING_ID" indicate that the BatteryPercentageRemaining  attribute access not support "Reportable".

2. Is zigbee sdk3.1 support any power config cluster attributes reporting ? I add power config cluster and then I can read BatteryVoltage and BatteryPercentageRemaining  attributes, but can not let them to do reporting.

Best Regards

Song

Parents
  • You need to edit the power config cluster header to enable reporting for voltage and percentage remaining. I am not sure if this is a bug (since the spec indicates these should be reportable) but I was able to get it working. I don't have the specific changes I made in front of me but can update this answer later today with the code you'll need to modify.

Reply
  • You need to edit the power config cluster header to enable reporting for voltage and percentage remaining. I am not sure if this is a bug (since the spec indicates these should be reportable) but I was able to get it working. I don't have the specific changes I made in front of me but can update this answer later today with the code you'll need to modify.

Children
  • Sorry for the delay. In zb_zcl_power_config.h, change the following defines to enable reporting on battery voltage and battery percentage:

    // Line 422
    #define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_VOLTAGE_ID(data_ptr, bat_num) \
    {                                                               \
      ZB_ZCL_ATTR_POWER_CONFIG_BATTERY##bat_num##_VOLTAGE_ID,       \
      ZB_ZCL_ATTR_TYPE_U8,                                          \
      ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_REPORTING,  \
      (zb_voidp_t) data_ptr                                         \
    }
    
    
    // Line 471
    #define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_REMAINING_ID(data_ptr, bat_num) \
    {                                                               \
      ZB_ZCL_ATTR_POWER_CONFIG_BATTERY##bat_num##_REMAINING_ID,     \
      ZB_ZCL_ATTR_TYPE_U8,                                          \
      ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_REPORTING,  \
      (zb_voidp_t) data_ptr                                         \
    }
    
    // Line 546
    #define ZB_ZCL_POWER_CONFIG_REPORT_ATTR_COUNT 3

  • Hi Patrick,

    Thank your reply. 

    I have already done this before I asked this question.

    I add the door state attribute of door lock cluster and it can report success, but the power config fail.

    It should be something I missed.

    I will to do more test. Thanks

    Best Regards

    Song

Related