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

[Zigbee] Multiple Temperature Clusters in the same device

Hello,

How can I have two or more temperature probes reporting using the ZCL library? 

Imagine that I want to have a device that measures for instance two temperatures at two different locations (Inside/Outside a fridge). How can I report these two temperatures? I learned that each application can have a set of clusters, but can I have duplicated clusters in the same application? If so, how can I do that? 

The cluster that I want to use is the temperature measurement (0x0402).

Thanks in advance,

Best regards, 

Fernando

Parents Reply Children
  • Hmm, ok. I thought in doing that, but then it would be necessary to assign a new device ID, or could they be the same?

  • You would only have multiple endpoint IDs. Depending on your coordinator this shouldn't be a problem but I have read that Smartthings does not have great support for multi-endpoint devices.

    In my opinion, this approach isn't ideal but it does seem to be the only way to handle multiple instances of the same cluster.

  • Have you ever thought of doing a customized cluster to handle this? Like one that has multiple attributes one for each temperature sensor?

    E.g: 

    ZB_ZCL_ATTR_TEMP_MEASUREMENT_1_VALUE_ID = 0x0000
    ZB_ZCL_ATTR_TEMP_MEASUREMENT_2_VALUE_ID = 0x0001
    ....
    e.t.c?
    Or is this a bad idea?
  • Hi Fernando,

    As it was pointed above one solution for this would be to have multiple endpoints in your device. Endpoints allow for separate control points to exist within each node. I have seend this implemented with On/Off cluster before, for instance having a switch device and a lightbulb device, each with multiple endpoints to have separately controllable lights in one device, and three separate toggle switches in another device, for example:

    Figure taken from the Zigbee Wireless Networking by Drew Gislason.

    One endpoint for each of your temperature sensor will give you more flexibility to control each sensor and configure attribute reporting in my opinion.

    I recommend you take a look at the BLE Thingy and Zigbee Color light bulb example inside the nRF5 SDK for Thread & Zigbee.

    Adding a custom cluster is also possible, but it will potentially require a bit more work on your side, and for interoperability purposes it's often best to stick to the clusters defined by the ZCL specification. If you want to go down that road you can take a look at the custom cluster implemented for pressure in zb_zcl_pressure_measurement.h and zb_zcl_pressure_measurement.c in the Zigbee Multi Sensor example in the SDK. See also 'Declaring Custom cluster'.

    Best regards,

    Marjeris

  • Hi Marjeris,

    Thank you for the reply.

    All that you said makes sense. However, my application requires some specific measurements not covered by the ZCL specification. So, I already went for that road and after some fight, I have already created my own customized cluster. 

    I'm a bit new to Zigbee and I have some questions that maybe you can help me with.

    I have two development kits, one running an end-device (with my customized cluster) and another one running the CLI configured as a coordinator.

    How can I discover the device source address and the containing endpoints without knowing in advance the profile ID and the implemented clusters? I know the existence of the zdo match_desc command but that requires me to fill the profile ID and also the implemented clusters.... 

    Another thing is, after running zdo simple_desc_req 0xF700 20 I get src_addr=0xF700 ep=20 profile_id=0x0104 app_dev_id=0xFFF2 app_dev_ver=0x0 in_clusters=0x0000,0x0003,0x0402,0x1234 out_clusters=0x0003, being the 0x1234 cluster-ID the one that I have customized. Well, my first question is, should I change the profile ID from the home automation to the manufacturer-specific profile? Or it's fine keeping the HA? My second question is if there is any command to request the attributes that a given cluster contains? Or this should be known in advance by looking at the ZCL specification? And what about the attribute type?

    Best regards,

    Fernando Fontes

Related