Problem with multiple Temperature Measurement clusters in ZHA?

Hi,

I am trying to build my own Zigbee device using an nRF52840 and I need some serious Zigbee protocol help!

I have the code written for the device and I can add it to my Zigbee network using ZHA. I have had lots of issues getting to this point, as the ZBOSS Zigbee API doesn’t like having multiple clusters of the same type.

I have two endpoints (11 and 12), each with their own temperature measurement cluster.

image

The diagnostics for the device read correctly, showing the two endpoints with the Temperature Sensor type and measurement cluster (0x0402)

"endpoints": {
        "11": {
          "profile_id": "0x0104",
          "device_type": "0x0302",
          "input_clusters": [
            "0x0000",
            "0x0003",
            "0x0402"
          ],
          "output_clusters": [
            "0x0003"
          ]
        },
        "12": {
          "profile_id": "0x0104",
          "device_type": "0x0302",
          "input_clusters": [
            "0x0000",
            "0x0003",
            "0x0402"
          ],
          "output_clusters": [
            "0x0003"
          ]
        },
        "242": {
          "profile_id": "0xa1e0",
          "device_type": "0x0061",
          "input_clusters": [],
          "output_clusters": [
            "0x0021"
          ]
        }
      },
      "manufacturer": "unk_manufacturer",
      "model": "unk_model"
    },

But I have an issue; of the two measurements shown, only one updates when I adjust my sensor.

My only clue to far is reconfiguring shows an error

and in the diagnostics, I see this:

2024-12-11 08:52:46.770 DEBUG (MainThread) [zigpy.zcl] [0x6D5A:12:0x0402] Received ZCL frame: b'\x18y\x07\x01\x00\x00\x00'
2024-12-11 08:52:46.770 DEBUG (MainThread) [zigpy.zcl] [0x6D5A:12:0x0402] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x18>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Server_to_Client: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=121, command_id=7, *direction=<Direction.Server_to_Client: 1>)
2024-12-11 08:52:46.771 DEBUG (MainThread) [zigpy.zcl] [0x6D5A:12:0x0402] Decoded ZCL frame: TemperatureMeasurement:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=<Status.FAILURE: 1>, direction=<ReportingDirection.SendReports: 0>, attrid=0)])
2024-12-11 08:52:46.771 DEBUG (MainThread) [zha.zigbee.cluster_handlers] [0x6D5A:12:0x0402]: Failed to configure reporting for '['measured_value']' on 'temperature' cluster: [ConfigureReportingResponseRecord(status=<Status.FAILURE: 1>, direction=<ReportingDirection.SendReports: 0>, attrid=0)]
2024-12-11 08:52:46.771 DEBUG (MainThread) [zha.zigbee.cluster_handlers] [0x6D5A:12:0x0402]: Successfully configured reporting for 'set()' on 'temperature' cluster
2024-12-11 08:52:46.772 DEBUG (MainThread) [zha] Emitting event zha_channel_configure_reporting with data ClusterConfigureReportingEvent(cluster_name='Temperature Measurement', cluster_id=1026, attributes={'measured_value': {'min': 30, 'max': 900, 'id': 'measured_value', 'name': 'measured_value', 'change': 50, 'status': 'FAILURE'}}, cluster_handler_unique_id='f4:ce:36:8c:ec:63:c2:92:12:0x0402', event_type='zha_channel_message', event='zha_channel_configure_reporting') (1 listeners)
2024-12-11 08:52:46.772 DEBUG (MainThread) [zha] (ZHADeviceProxy) handling event protocol for event: ClusterConfigureReportingEvent(cluster_name='Temperature Measurement', cluster_id=1026, attributes={'measured_value': {'min': 30, 'max': 900, 'id': 'measured_value', 'name': 'measured_value', 'change': 50, 'status': 'FAILURE'}}, cluster_handler_unique_id='f4:ce:36:8c:ec:63:c2:92:12:0x0402', event_type='zha_channel_message', event='zha_channel_configure_reporting')

which, to me anyway, shows an issue with configuring the reporting.

My best guess is that when ZHA sends the reporting configuration, ZBOSS gets confused as there are two temperature measurement clusters. It’s clear that ZBOSS doesn’t work well with duplicate clusters.

I am a novice with Zigbee, so any tips, pointers or direction would be very welcome!!!

After a lot of reading and experimenting, I finally got my Zigbee sensor working as expected.

The problem was with my Nordic code. Using an age-old answer on Nordic’s forum and some code on Github, I got it working!

For anyone interested, full write up here: