Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zigbee home automation profile's Thermostat cluster

Hello Everyone,

I am developing one product for the HVAC system. I have Radiator and STM's primary MCU. For development, I need to configure the thermostat cluster ID for controlling the Radiator command using the Zigbee gateway.

My System is as follows,

nRF52840 Zigbee MCU communicates STM's MCU via UART, there happens a command exchange between these 2 MCU's. And user gives a command using Zigbee base Gateway for cloud communication.

So, for this, I need a thermostat cluster-ID and controlling commands and ids.

I tried to find the document for the same but I could not.

Can anyone help me with how to enable the thermostat cluster in light_bulb code and modify it as per my requirement. Any documents or links would help me to study the same.

Thanks and Regards

Rohit R

Parents
  • Hi Rohit,

    The cluster ID for the thermostat cluster is 0x201. You can find this, as well as any other IDs and information about standard Zigbee clusters in the Zigbee Cluster Library specification. In revision 6, which can be found here, the cluster list is found in chapter 6.1.3, and the thermostat cluster is found in chapter 6.3. The thermostat cluster consists of two attribute sets: thermostat information (0x000) and thermostat settings (0x001), both of which has their own lists of attributes. These attributes and their corresponding IDs are all found in the specification.

    Standard Zigbee clusters are also defined in the file external\zboss\include\zcl\zb_zcl_common.h in the SDK, where you can find the thermostat cluster identifier ZB_ZCL_CLUSTER_ID_THERMOSTAT.

    As for implementing the thermostat cluster into your application, I would recommend taking a look at the information about implementing a Zigbee product with ZCL.

    Best regards,

    Marte

  • Hi Marte,

    with reference to your links regarding the Zigbee cluster, In the light bulb code, I tried to add a thermostat cluster but I am getting too many errors. Plus it says basic attributes are not found but which is the same for all clusters.

    Here is the snippet that I tried,

    /* Declare endpoint for thermostat device. */
    #define ZB_HA_DECLARE_THERMOSTAT_EP(ep_name,ep_id,cluster_list) 	
            ZB_ZCL_DECLARE_THERMOSTAT_SIMPLE_DESC(ep_name, ep_id,                   \
            ZB_HA_THERMOSTAT_IN_CLUSTER_NUM, ZB_HA_THERMOSTAT_OUT_CLUSTER_NUM);     \
            ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info## device_ctx_name,    \
                                         ZB_HA_THERMOSTAT_REPORT_ATTR_COUNT);       \
            ZB_AF_DECLARE_ENDPOINT_DESC(ep_name, ep_id, ZB_AF_HA_PROFILE_ID,        \
                                        0,                                          \
                                        NULL,                                       \
                                        ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), \
                                        cluster_list,                               \
                                        (zb_af_simple_desc_1_1_t*)&simple_desc_##ep_name,                       \
                                        ZB_HA_THERMOSTAT_REPORT_ATTR_COUNT, 
                                        reporting_info## device_ctx_name,   \
                                        0, NULL)
    
    	
    
    /* Basic cluster attributes. */
    typedef struct
    {
        zb_uint8_t zcl_version;
        zb_uint8_t app_version;
        zb_uint8_t stack_version;
        zb_uint8_t hw_version;
        zb_char_t  mf_name[32];
        zb_char_t  model_id[32];
        zb_char_t  date_code[16];
        zb_uint8_t power_source;
        zb_char_t  location_id[17];
        zb_uint8_t ph_env;
        zb_char_t  sw_ver[17];
    } thermostat_device_basic_attr_t;
    
    /* Identify cluster attributes. */
    typedef struct
    {
        zb_uint16_t identify_time;
    } thermostat_device_identify_attr_t;
    
    /*the thermostat cluster attributes*/
    typedef struct
    {
        zb_uint16_t  ui16localTemperature;
        zb_uint16_t  ui16OutdoorTemperature;
        zb_uint16_t  i16AbsMinHeatSetpointLimit;
        zb_uint16_t ui16AbsMaxHeatSetpointLimit;
        zb_uint16_t ui16AbsMinCoolSetpointLimit;
        zb_uint16_t ui16AbsMaxCoolSetpointLimit;
        zb_uint8_t ui8PICoolingDemand;
        zb_uint8_t ui8PIHeatingDemand;
        zb_uint8_t ui8LocalTemperatureCalibration;
        zb_uint16_t ui16OccupiedCoolingSetpoint;
        zb_uint16_t ui16OccupiedHeatingSetpoint;
        zb_uint16_t ui16UnoccupiedCoolingSetpoint;
        zb_uint16_t ui16UnoccupiedHeatingSetpoint;
        zb_uint16_t ui16MinHeatSetpointLimit;
        zb_uint16_t ui16MaxHeatSetpointLimit;
        zb_uint16_t ui16MinCoolSetpointLimit;
        zb_uint16_t ui16MaxCoolSetpointLimit;
        zb_uint8_t ui8MinSetpointDeadBand;
        zb_uint16_t u16ClusterRevision;
    }thermostat_device_cld_attr_t;
    
    /* Main application customizable context. Stores all settings and static values. */
    typedef struct
    {
        thermostat_device_basic_attr_t         basic_attr;
        thermostat_device_identify_attr_t      identify_attr;
        thermostat_device_cld_attr_t           thermostat_attr;
    
    } thermostat_device_ctx_t;
    
    static thermostat_device_ctx_t m_dev_ctx;
    
    //declaration TBD, added as per knowleadge not tested
    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &m_dev_ctx.identify_attr.identify_time);
    
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(basic_attr_list,
                                         &m_dev_ctx.basic_attr.zcl_version,
                                         &m_dev_ctx.basic_attr.app_version,
                                         &m_dev_ctx.basic_attr.stack_version,
                                         &m_dev_ctx.basic_attr.hw_version,
                                         m_dev_ctx.basic_attr.mf_name,
                                         m_dev_ctx.basic_attr.model_id,
                                         m_dev_ctx.basic_attr.date_code,
                                         &m_dev_ctx.basic_attr.power_source,
                                         m_dev_ctx.basic_attr.location_id,
                                         &m_dev_ctx.basic_attr.ph_env,
                                         m_dev_ctx.basic_attr.sw_ver);
    
    
    ZB_HA_DECLARE_THERMOSTAT_ATTRIB_LIST ( thermostat_clusters,
                                              basic_attr_list,
                                              identify_attr_list,
                                              thermostat_attr_list); 	
    
    ZB_HA_DECLARE_THERMOSTAT_CLUSTER_LIST(cluster_list_name,
                                              thermostat_device_basic_attr_t,
                                              thermostat_device_identify_attr_t,
                                              thermostat_device_cld_attr_t,
                                              thermostat_attr_list); 	
    
    		  // ZBOSS_DECLARE_DEVICE_CTX_1_EP(device_ctx, ep_name)
    
    
    ZB_HA_DECLARE_THERMOSTAT_EP (thermostat_ep,HA_DIMMABLE_LIGHT_ENDPOINT,thermostat_clustter); 	
    
    ZB_HA_DECLARE_THERMOSTAT_CTX (thermostat_ctx,
                                     thermostat_clusters_ep 
                                     ); 

    - And I also, what is are the values for below MACROS for the thermostat,

    #define HA_DIMMABLE_LIGHT_ENDPOINT        10                                    /**< Device endpoint, used to receive light controlling commands. */
    #define ERASE_PERSISTENT_CONFIG           ZB_FALSE                              /**< Do not erase NVRAM to save the network parameters after device reboot or power-off. */

    /* Basic cluster attributes initial values. */
    #define BULB_INIT_BASIC_APP_VERSION       01                                    /**< Version of the application software (1 byte). */
    #define BULB_INIT_BASIC_STACK_VERSION     10                                    /**< Version of the implementation of the ZigBee stack (1 byte). */
    #define BULB_INIT_BASIC_HW_VERSION        11                                    /**< Version of the hardware of the device (1 byte). */
    #define BULB_INIT_BASIC_MANUF_NAME        "Nordic"                              /**< Manufacturer name (32 bytes). */
    #define BULB_INIT_BASIC_MODEL_ID          "Dimable_Light_v0.1"                  /**< Model number assigned by manufacturer (32-bytes long string). */
    #define BULB_INIT_BASIC_DATE_CODE         "20180416"                            /**< First 8 bytes specify the date of manufacturer of the device in ISO 8601 format (YYYYMMDD). The rest (8 bytes) are manufacturer specific. */
    #define BULB_INIT_BASIC_POWER_SOURCE      ZB_ZCL_BASIC_POWER_SOURCE_DC_SOURCE   /**< Type of power sources available for the device. For possible values see section 3.2.2.2.8 of ZCL specification. */
    #define BULB_INIT_BASIC_LOCATION_DESC     "Office desk"                         /**< Describes the physical location of the device (16 bytes). May be modified during commisioning process. */
    #define BULB_INIT_BASIC_PH_ENV            ZB_ZCL_BASIC_ENV_UNSPECIFIED

    I tried to find but I did not get any source for same. Can you please help where I did do wrong.

    Or please share if anyone built a thermostat example. I have very little time need to finish the project as soon as possible but I am stuck here,

    Thanks in advance,

    Rohit R

  • Hi Marte,

    Any update on this above query.

    Thanks and Regards

    Rohit R

  • Hi Rohit,

    This will be handled in this case as I mentioned there.

    Best regards,

    Marte

Reply Children
No Data
Related