Reporting Error

I am trying to configure reporting for my battery alarm, but every time I try to do this, I get the below log warnings. I use the below code to do this, and my device is ZigBee. I also checked messages sent over the air, using a ZigBee sniffer, and I can see that the hub sends the configureReporting message, but my device returns “Status: [0x87] Invalid Value.” Can anyone help me fix this so that I can correctly configure reporting for my battery alarm?

zigbee.configureReporting(CLUSTER_POWER, MAINS_ALARM_MASK, 0x18, 30, 21600, 0x01)

My reference:

You could try changing the 0x01 to a null because that attribute data type is a discrete data type. You only need to specify a non-null value for the last parameter for analog data types.

However if your goal is to setup battery alarm reporting I think you need to configure reporting of attribute 0x003E which is battery alarm state:

zigbee.configureReporting(CLUSTER_POWER, 0x003E, 0x1B, 30, 21600, null)

I tried changing it to null, but I still get the same error message. What else should I try?

I’m wondering if that attribute isn’t reportable. This is what the ZCL spec says will result in an invalid value error:

Else, if the minimum reporting interval field is less than any minimum set by the relevant cluster specification or application profile, or the value of the maximum reporting interval field is non-zero and is less than that of the minimum reporting interval field, the device shall construct an attribute status record with the
status field set to INVALID_VALUE.

I don’t see anything that says that MainsAlarmMask isn’t reportable but right above the definition of that attribute it does say

The alarm settings in this table require the Alarms cluster to be implemented on the same device - see Dependencies. If the Alarms cluster is not present on the same device they may be omitted.

Did you try attribute BatteryAlarmState (0x003E)? MainsAlarmMask just indicates what alarms may be generated but BatteryAlarmState is the current state of the device’s battery alarms.

I found out I had to allow my device to be reportable in order to work to configure reporting correctly. Anyways, I want to ask how I could program my device handler to be able to read each value in a bitmap?