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
  • Seems we are working on similar projects. The approach I am taking is to have multiple endpoints, with each having an instance of the temperature measurement cluster.

  • 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?

  • 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

  • Fernando Fontes said:
    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.... 

    You only need to fill the profile id for 'zdo match_desc', which usually is either Zigbee Light Link (0xc05e) or the Home Automation profile (0x0104) at least for lighting devices. The number of input cluster or output clusters argument is just so you can sort it in case you need to find a device with at least one of n_input clusters. All devices should have at least the basic cluster, so you could send a match descriptor request requiring for devices with at least the Basic cluster implementation if you want a list of all devices.

    The other way would be to use a zigbee sniffer and look at the devices available on the network.

    Fernando Fontes said:
    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?

     I think manufacturer-specific profiles will need to be register with the Zigbee Alliance. You can create a custom cluster inside the HA profile. If you need a custom profile is up to you and your implementation. Please refer to the Zigbee Alliance for more information on this. From what I read private profiles are usually implemented for applications that do not need to interact with other vendors' products.

    Fernando Fontes said:
    My second question is if there is any command to request the attributes that a given cluster contains?

     The closer thing we have is 'zcl attr read', but this is for reading the values of a given attributes. I cannot see to find anything about attribute discovery in the specification, but you could check for yourself as well, to see if this is even possible. For cluster on the ZCL specification each attribute is documented on the specification, also with the attribute type. For custom cluster you will need to document this yourself I suppose.

    Best regards,

    Marjeris

  • Hi Marjeris, 

    Thank you for the help. 

    One last question though: What about the clusters IDs? Is there any rule to choose a cluster ID for my own cluster implementation?

    Best regards.

  • Fernando Fontes said:
    Is there any rule to choose a cluster ID for my own cluster implementation?

     No, I don't think so :) just don't use one of the IDs already used in the ZCL specification.

Reply Children
No Data
Related