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

Thermostat cluster enable issue

Hi All,

I am developing product using nRF52840 and SDK nRF5_SDK_for_Thread_and_Zigbee_v3.0.0_d310e71.

This product is basically, using the Thermostat cluster and Zigbee protocol to communicate with the Zigbee gateway.

So, I referred light_bulb example and followed steps to enable "Thermostat cluster and attributes".

I have included the respective files also but I am unable to execute the below callback function case statement,

static zb_void_t zcl_device_cb(zb_uint8_t param)
{
    zb_uint8_t                       cluster_id;
    zb_uint8_t                       attr_id;
    zb_buf_t                       * p_buffer = ZB_BUF_FROM_REF(param);
    zb_zcl_device_callback_param_t * p_device_cb_param =
                     ZB_GET_BUF_PARAM(p_buffer, zb_zcl_device_callback_param_t);

    NRF_LOG_INFO("zcl_device_cb id %hd", p_device_cb_param->device_cb_id);

    /* Set default response value. */
    p_device_cb_param->status = RET_OK;

    switch (p_device_cb_param->device_cb_id)
    {
        case ZB_ZCL_SET_ATTR_VALUE_CB_ID:
            cluster_id = p_device_cb_param->cb_param.set_attr_value_param.cluster_id;
            attr_id    = p_device_cb_param->cb_param.set_attr_value_param.attr_id;

            if (cluster_id == ZB_ZCL_CLUSTER_ID_THERMOSTAT)
            {
                uint16_t value = p_device_cb_param->cb_param.set_attr_value_param.values.data16;

                NRF_LOG_INFO("thermostat local temperature: %d", value);
                if (attr_id == ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_ID)
                {
                    local_temperature_value(value);
                }
            }
            else
            {
                /* Other clusters can be processed here */
                NRF_LOG_INFO("Unhandled cluster attribute id: %d", cluster_id);
            }
        break;

        default:
            p_device_cb_param->status = RET_ERROR;
            break;
    }

    NRF_LOG_INFO("zcl_device_cb status: %hd", p_device_cb_param->status);
}

Also, I am attaching code for reference please let me know what else I forgot to enable the functions. It is urgent for me to solve this issue.

Radiator_nRF_v0.9.0.zip

And, with these attributes, for some of the commands, I need to implement custom attributes so if you share how to add custom attributes to this cluster.

Thanks in advance.

Regards,

Rohit R

  • Hi Marte,

    Okay, thanks for the feedback.

    Sorry for the inconvenience might be project not attached properly. Now I do not want to add a custom cluster or any new cluster. so let's close this here.

    I want to add manufacturer attributes now.

    Have you checked the nxp document and the section mentioned in another ticket?.

    In that section, they have explained the enabling procedure for adding manufacturer attributes to any cluster. And I want the same requirement/procedure for my product.

    I want to enable manufacturer Id and add extra attribute IDs to the thermostat cluster from (extra attribute id - 0x4000 to 0x4008) and do read/write operation on extra added attributes.

    So let me know how I can add extra manufacturer attribute ids to the thermostat cluster (cluster id - 0x0201).

    And,

     This is required if you want to get the contents of the next read attribute response frame yourself with ZB_ZCL_GENERAL_GET_NEXT_READ_ATTR_RES. Usually, sending and parsing attribute requests are handled internally by the stack. If you want to get the contents of this, you will have to implement a handler for this, such as is done with cli_agent_ep_handler_attr(). This intercepts the frames coming to your device so that you can do something with them yourself, instead of everything being done by the stack.

    - Okay, this I will check parallelly.

    But my first task is to complete adding manufacturer attribute Id to the thermostat cluster.

    So let me know the procedure for same to adding attributes.

    Note,

    I do not want to enable a custom cluster.

    Thanks and Regards

    Rohit

  • Hi Marte,

    Can you please explain me below points,

    My test case today,

    I ran the light_bulb on dev-kit nrf52840 and discovered with my Gateway(one I am going to use for thermostat).

    On gateway's GUI I can see the on_off cluster with ZLL extension and Tuya special.

    attached is the image for light_bulb code.

    I have marked 2 points on image. Can you please explain me how to enable those 2 points in thermostat cluster. This is what I want manufacturer attributes means.

    Let me know how you have enabled ZLL extension and Tuya special attribute in on_off cluster. Same method i will follow and it will solve my problem.

    In place ZLL and Tuya I will add my manufacture name and add attributes. Even I need same attributes Id from 0x4000 to 0x4008. I think it will solve my problem adding extra attribute to thermostat cluster. I tried to find this procedure but I couldn't. So please let me know.

    Thanks and Regards

    Rohit

  • Hi,

    Any update to my request?

    Thanks and Regards

    Rohit R

  • Hi Rohit,

    I have tried to add custom attributes to existing clusters, but I have not been able to yet. My initial idea was to create an extended attribute list, such as in for example the basic cluster. However, it does not seem to work. This might be because the the clusters are implemented and precompiled in the stack, so changing the clusters themselves might not be possible. I have asked our developers about this, and whether it is possible to add custom attributes to existing clusters or not, but I have not received a response yet. I will let you know when I do.

    The ZLL attributes in your picture, Global Scene Control, On Time, Off Wait Time and Start Up On Off, are already in the attribute list of the On/Off cluster. However, you must use zb_zcl_on_off_attrs_ext_t and not zb_zcl_on_off_attrs_t. This can be found in the add on file for the On/Off cluster, zb_zcl_on_off_addons.h. This is true for other clusters with extended attribute lists or add ons as well. All of these can be found in the folder external\zboss\addons\zcl.

    I am not sure what Tuya is. Is it a manufacturer specific attribute?

    Best regards,

    Marte

  • Hi Marte, 

    I have tried to add custom attributes to existing clusters, but I have not been able to yet. My initial idea was to create an extended attribute list, such as in for example the basic cluster. However, it does not seem to work. This might be because the the clusters are implemented and precompiled in the stack, so changing the clusters themselves might not be possible. I have asked our developers about this, and whether it is possible to add custom attributes to existing clusters or not, but I have not received a response yet. I will let you know when I do.

    - Okay, Thank you and let me know once you got any feedback, I will wait for further information from you.

    The ZLL attributes in your picture, Global Scene Control, On Time, Off Wait Time and Start Up On Off, are already in the attribute list of the On/Off cluster. However, you must use zb_zcl_on_off_attrs_ext_t and not zb_zcl_on_off_attrs_t. This can be found in the add on file for the On/Off cluster, zb_zcl_on_off_addons.h. This is true for other clusters with extended attribute lists or add ons as well. All of these can be found in the folder external\zboss\addons\zcl.

    - yes, I have used this in my one our product. As it precompiled in stack so using extended is easy. But to current project I do not know to add addition attribute id and access them in project. 

    - Let me know if you got any update from team. 

    I am not sure what Tuya is. Is it a manufacturer specific attribute?

    - I do not know. what is this? I just saw on GUI while using on_off cluster. 

    Thanks and Regards

    Rohit

Related