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

Parents
  • Hi,

    It's been 5days. I haven't received any update to my latest queries?

    Is there any update?

    Thanks and regards

    Rohit R

  • Hi Rohit,

    I am sorry for not keeping you informed about my process and not updating you earlier. I am testing out some things regarding your last queries to confirm that everything is correct, and to check the point about cli_agent_ep_handler_attr(). I will come back to you very soon, later today, when I am done testing.

    Best regards,

    Marte

  • Hi,

    Any update on my other ticket problem. 

    How to add custom (manufacturers)attributes to thermostat cluster like I shared nxp document. 

    I need details step by step procedure it is urgent to solve. 

    That ticket is closed. 

    Thanks and Regards

    Rohit 

  • Hi,

    The project you attached in your other case does not contain the implementation of the custom cluster, only the custom thermostat device, so I am unable to see if there is anything wrong in the cluster implementation, and to test the project. I also do not see there you are declaring the ID of the attribute, as that is in the cluster implementation. 

    When are you getting the errors? When building, or when the application is running?

    Rohit Rajapure said:
    But what are these points. Is it required?. I got confused so I did not include it in my code.

     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.

    Best regards,

    Marte

Reply
  • Hi,

    The project you attached in your other case does not contain the implementation of the custom cluster, only the custom thermostat device, so I am unable to see if there is anything wrong in the cluster implementation, and to test the project. I also do not see there you are declaring the ID of the attribute, as that is in the cluster implementation. 

    When are you getting the errors? When building, or when the application is running?

    Rohit Rajapure said:
    But what are these points. Is it required?. I got confused so I did not include it in my code.

     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.

    Best regards,

    Marte

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

Related