ncs-zigbee - Configuration issue with custom cluster

Hi,

I write this information for the sake of completeness. I don´t need Zigbee2MQTT support from you. Instead, support with the Zigbee firmware is required.

I´m working on an open-source Zigbee environment sensor, based on an nRF54L14, and I have a problem with a customized cluster for VOC. You can find the complete repo with the firmware here:

https://github.com/Kampi/BeeLight

I use Zigbee2MQTT for the Zigbee network, and I get a configuration error when starting the service. The Zigbee2MQTT team told me that this issue is firmware-based. You can see the ticket for this problem here:

https://github.com/Koenkk/zigbee-herdsman-converters/issues/10831#issuecomment-3568319658

I don´t understand why this issue is related to the VOC cluster only, because the cluster looks basically the same. But I don´t have a deep understanding of ZBOSS and the underlying mechanism, so I need some help to understand the issue and a potential solution. The complete VOC cluster looks like this

#ifndef ZB_ZCL_BEELIGHT_VOC_MEASUREMENT_H_
#define ZB_ZCL_BEELIGHT_VOC_MEASUREMENT_H_

#include <zcl/zb_zcl_common.h>
#include <zcl/zb_zcl_commands.h>

enum zb_zcl_voc_cluster_attr_e
{
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_ID        = 0x0000,
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID    = 0x0001,
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID    = 0x0002,
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_ID    = 0x0003,
};

/** @brief Default value for VOC Measurement cluster revision global attribute */
#define ZB_ZCL_BEELIGHT_VOC_MEASUREMENT_CLUSTER_REVISION_DEFAULT             ((zb_uint16_t)0x0001U)

/** @brief MeasuredValue attribute unknown value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_UNKNOWN                   ((zb_uint16_t)0x8000)

/** @brief MinMeasuredValue attribute minimum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_MIN_VALUE             ((zb_uint16_t)0x0000)

/** @brief MinMeasuredValue attribute maximum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_MAX_VALUE             ((zb_uint16_t)0x2710)

/** @brief MinMeasuredValue attribute invalid value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_INVALID               ((zb_uint16_t)0x8000)

/** @brief MaxMeasuredValue attribute minimum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_MIN_VALUE             ((zb_uint16_t)0x0000)

/** @brief MaxMeasuredValue attribute maximum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_MAX_VALUE             ((zb_uint16_t)0x2710)

/** @brief MaxMeasuredValue attribute invalid value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_INVALID               ((zb_uint16_t)0x8000)

/** @brief Tolerance attribute minimum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_MIN_VALUE             ((zb_uint16_t)0x0000)

/** @brief Tolerance attribute maximum value */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_MAX_VALUE             ((zb_uint16_t)0x000F)

/** @brief Default value for Value attribute */
#define ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_DEFAULT_VALUE             ((zb_uint16_t)0x0000)

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_ID(data_ptr)          \
{                                                                                               \
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_ID,                                              \
    ZB_ZCL_ATTR_TYPE_U16,                                                                       \
    ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_REPORTING,                                \
    (ZB_ZCL_NON_MANUFACTURER_SPECIFIC),                                                         \
    (void*) data_ptr                                                                            \
}

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID(data_ptr)      \
{                                                                                               \
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID,                                          \
    ZB_ZCL_ATTR_TYPE_U16,                                                                       \
    ZB_ZCL_ATTR_ACCESS_READ_ONLY,                                                               \
    (ZB_ZCL_NON_MANUFACTURER_SPECIFIC),                                                         \
    (void*) data_ptr                                                                            \
}

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID(data_ptr)      \
{                                                                                               \
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID,                                          \
    ZB_ZCL_ATTR_TYPE_U16,                                                                       \
    ZB_ZCL_ATTR_ACCESS_READ_ONLY,                                                               \
    (ZB_ZCL_NON_MANUFACTURER_SPECIFIC),                                                         \
    (void*) data_ptr                                                                            \
}

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_ID(data_ptr)      \
{                                                                                               \
    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_ID,                                          \
    ZB_ZCL_ATTR_TYPE_U8,                                                                        \
    ZB_ZCL_ATTR_ACCESS_READ_ONLY,                                                               \
    (ZB_ZCL_NON_MANUFACTURER_SPECIFIC),                                                         \
    (void*) data_ptr                                                                            \
}

/** @brief Number of attributes mandatory for reporting in BeeLight VOC Measurement cluster */
#define ZB_ZCL_BEELIGHT_VOC_MEASUREMENT_REPORT_ATTR_COUNT 1

/** @brief Declare attribute list for BeeLight VOC Measurement cluster - server side
    @param attr_list - attribute list name
    @param value - pointer to variable to store MeasuredValue attribute
    @param min_value - pointer to variable to store MinMeasuredValue attribute
    @param max_value - pointer to variable to store MAxMeasuredValue attribute
    @param tolerance - pointer to variable to store Tolerance attribute
*/
#define ZB_ZCL_DECLARE_BEELIGHT_VOC_MEASUREMENT_ATTRIB_LIST(attr_list, value, min_value, max_value, tolerance)  \
    ZB_ZCL_START_DECLARE_ATTRIB_LIST_CLUSTER_REVISION(attr_list, ZB_ZCL_BEELIGHT_VOC_MEASUREMENT)               \
    ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_ID, (value))                                \
    ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID, (min_value))                        \
    ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID, (max_value))                        \
    ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_TOLERANCE_ID, (tolerance))                        \
    ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST

void zb_zcl_beelight_voc_measurement_init_server(void);
void zb_zcl_beelight_voc_measurement_init_client(void);

#define ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT_SERVER_ROLE_INIT zb_zcl_beelight_voc_measurement_init_server
#define ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT_CLIENT_ROLE_INIT zb_zcl_beelight_voc_measurement_init_client

#endif /* ZB_ZCL_BEELIGHT_VOC_MEASUREMENT_H_ */

#include "zb_common.h"

#if defined (ZB_ZCL_SUPPORT_CLUSTER_BEELIGHT_VOC_MEASUREMENT)

#include "zb_zcl.h"
#include "zb_aps.h"
#include "zcl/zb_zcl_common.h"

zb_ret_t check_value_beelight_voc_measurement_server(zb_uint16_t attr_id, zb_uint8_t endpoint, zb_uint8_t *value);
void zb_zcl_beelight_voc_measurement_write_attr_hook_server(zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code);

void zb_zcl_beelight_voc_measurement_init_server(void)
{
    zb_zcl_add_cluster_handlers(ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT,
                                ZB_ZCL_CLUSTER_SERVER_ROLE,
                                check_value_beelight_voc_measurement_server,
                                zb_zcl_beelight_voc_measurement_write_attr_hook_server,
                                (zb_zcl_cluster_handler_t)NULL);
}

void zb_zcl_voc_measurement_init_client(void)
{
    zb_zcl_add_cluster_handlers(ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT,
                                ZB_ZCL_CLUSTER_CLIENT_ROLE,
                                (zb_zcl_cluster_check_value_t)NULL,
                                (zb_zcl_cluster_write_attr_hook_t)NULL,
                                (zb_zcl_cluster_handler_t)NULL);
}

zb_ret_t check_value_beelight_voc_measurement_server(zb_uint16_t attr_id, zb_uint8_t endpoint, zb_uint8_t *value)
{
    zb_ret_t ret = RET_OK;
    zb_int16_t val = ZB_ZCL_ATTR_GET16(value);

    TRACE_MSG(TRACE_ZCL1, "> check_value_beelight_voc_measurement, attr_id %d, val %d", (FMT__D_D, attr_id, val));

    switch (attr_id)
    {
        case ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_ID:
            if (ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_VALUE_UNKNOWN == val)
            {
                ret = RET_OK;
            }
            else
            {
                zb_zcl_attr_t *attr_desc = zb_zcl_get_attr_desc_a(endpoint,
                    ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT,
                    ZB_ZCL_CLUSTER_SERVER_ROLE,
                    ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID);
                ZB_ASSERT(attr_desc);

                ret = (ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc) == ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_INVALID ||
                    ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc) <= val)
                    ? RET_OK : RET_ERROR;

                if (ret)
                {
                    attr_desc = zb_zcl_get_attr_desc_a(endpoint,
                        ZB_ZCL_CLUSTER_ID_BEELIGHT_VOC_MEASUREMENT,
                        ZB_ZCL_CLUSTER_SERVER_ROLE,
                        ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID);
                    ZB_ASSERT(attr_desc);

                    ret = ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc) == ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_INVALID ||
                            val <= ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc)
                        ? RET_OK : RET_ERROR;
                }
            }
            break;

        case ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_ID:
            ret = ((ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_MIN_VALUE <= val) &&
                    (val <= ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_MAX_VALUE)) ||
                    (ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MIN_VALUE_INVALID == val)
                    ? RET_OK : RET_ERROR;
            break;

        case ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_ID:
            ret = ( (ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_MIN_VALUE <= ZB_ZCL_ATTR_GET16(value)) &&
                    (ZB_ZCL_ATTR_GET16(value) <= ZB_ZCL_ATTR_BEELIGHT_VOC_MEASUREMENT_MAX_VALUE_MAX_VALUE) )
                    ? RET_OK : RET_ERROR;
            break;

        default:
            break;
    }

    TRACE_MSG(TRACE_ZCL1, "< check_value_beelight_voc_measurement ret %hd", (FMT__H, ret));

    return ret;
}

void zb_zcl_beelight_voc_measurement_write_attr_hook_server(zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code)
{
    ZVUNUSED(new_value);
    ZVUNUSED(endpoint);
    ZVUNUSED(manuf_code);
    ZVUNUSED(attr_id);

    TRACE_MSG(TRACE_ZCL1, ">> zb_zcl_beelight_voc_measurement_write_attr_hook endpoint %hd, attr_id 0x%x, manuf_code 0x%x",
                (FMT__H_D_D, endpoint, attr_id, manuf_code));

    /* All attributes in this cluster are read-only. Do nothing */

    TRACE_MSG(TRACE_ZCL1, "<< zb_zcl_beelight_voc_measurement_write_attr_hook", (FMT__0));
}

#endif /* ZB_ZCL_SUPPORT_CLUSTER_VOC_MEASUREMENT */

As far as I understand the error message, the error happens somewhere during the configuration of this cluster. Where does this configuration happen and how can I enable debug outputs to see the issue in the firmware? Or is something wrong with the cluster definition (it´s based on the temperature measurement cluster). The current firmware doesn´t output any Zigbee-related errors yet.

Parents
  • Hello,

    Can you please specify exactly what error message you are seeing? Also, what HW are you running on? nRF54L15 DK or custom HW? And do you have access to UART Logging? USB logging? RTT Logging?

    And what NCS version are you using?

    Best regards,

    Edvin

  • Hi Edvin,

    it´s a custom hardware with an nRF54L15 module and I have RTT logging available. I´m using NCS v2.9.2 with ncs-zigbee main.

    https://github.com/Kampi/BeeLight/blob/2.1_Dev/firmware/app/west.yml

    The error message from Z2M is the following

    [2025-11-23 13:10:04] error:    z2m: Failed to configure '0x86d79ac5bae41fa3', attempt 4 (Error: ZCL command 0x86d79ac5bae41fa3/10 msBeelightVOC.configReport([{"minimumReportInterval":300,"maximumReportInterval":3600,"reportableChange":5,"attribute":"measuredValue"}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'FAILURE')

  • Hi Edwin,

    mmh it confuses me even more. I don´t get the difference between my clusters and the default rel. humidity cluster. The default rel. Zigbee2MQTT can configure the humidity cluster 

    But the same logic doesn´t work for my cluster.

  • Hello,

    The picture you tried to upload didn't load properly. Can you please try to upload it again?

    Is there some way for me to reproduce what you are seeing using some DKs, without a 3rd party Zigbee coordinator? Are you able to reproduce it using the ncs-zigbee\samples\shell, and try to do the same that your zigbee coordinator is doing? 

    Best regards,

    Edvin

  • Hi Edvin,

    I will try it with the NCS Zigbee Shell on my nRF54L15 DK and my sensor. I get this output during the first test of the shell sample:

    uart:~$ bdb start
    Started router
    Done
    [00:00:04.469,697] <inf> zigbee_app_utils: Production configuration is not present or invalid (status: -1)
    [00:00:04.469,918] <inf> zigbee_app_utils: Zigbee stack initialized
    [00:00:04.471,944] <inf> zigbee_app_utils: Device started for the first time
    [00:00:04.471,952] <inf> zigbee_app_utils: Start network steering
    [00:00:04.471,959] <inf> zigbee_app_utils: Started network rejoin procedure.
    [00:00:08.167,488] <inf> zigbee_app_utils: Network steering was not successful (status: -1)
    [00:00:12.831,348] <inf> zigbee_app_utils: Network steering was not successful (status: -1)
    [00:00:19.488,889] <inf> zigbee_app_utils: Network steering was not successful (status: -1)
    [00:00:30.138,843] <inf> zigbee_app_utils: Network steering was not successful (status: -1)
    [00:00:48.788,114] <inf> zigbee_app_utils: Network steering was not successful (status: -1)
    

    And I flashed the Zigbee config before by running

    nrfjprog --program zigbee_config.hex --verify

    With this config

    # Enable channel 11 and 16
    channel_mask: 0x10800
    
    # You can add an installation code here
    # NOTE: This code must be added to the Zigbee network too!
    #install_code: 83FED3407A939723A5C639B26916D505
    
    # The Zigbee device address
    extended_address: 86D79AC5BAE41F11
    
    tx_power: 0
    
    # Use this to pass specific data to the application
    #app_data: 01ABCD
    

    Is there anything special to take care of when using this config file, or why isn´t the MCU using this config?

  • Hi  ,

    I´ve tested a bit further with my nRF54L15 DK because my nRF5340 has the same issue. I must modify my project to support the regular nRF54DK so I decided to play around with the light bulb example with Zigbee2MQTT. The example is working without issues in a basic installation Zigbee2Mqtt and then I added the temperature cluster

    /*
     * Copyright (c) 2024 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
     */
    
    #ifndef ZB_DIMMABLE_LIGHT_H
    #define ZB_DIMMABLE_LIGHT_H 1
    
    /**
     *  @defgroup ZB_DEFINE_DEVICE_DIMMABLE_LIGHT Dimmable Light
     *  @{
     *  @details
     *      - @ref ZB_ZCL_BASIC \n
     *      - @ref ZB_ZCL_IDENTIFY \n
     *      - @ref ZB_ZCL_SCENES \n
     *      - @ref ZB_ZCL_GROUPS \n
     *      - @ref ZB_ZCL_ON_OFF \n
     *      - @ref ZB_ZCL_LEVEL_CONTROL
     */
    
    /** Dimmable Light Device ID */
    #define ZB_DIMMABLE_LIGHT_DEVICE_ID 0x0101
    
    /** Dimmable light device version */
    #define ZB_DEVICE_VER_DIMMABLE_LIGHT 1
    
    /** @cond internals_doc */
    
    /** Dimmable Light IN (server) clusters number */
    #define ZB_DIMMABLE_LIGHT_IN_CLUSTER_NUM 7
    
    /** Dimmable Light OUT (client) clusters number */
    #define ZB_DIMMABLE_LIGHT_OUT_CLUSTER_NUM 0
    
    /** Dimmable light total (IN+OUT) cluster number */
    #define ZB_DIMMABLE_LIGHT_CLUSTER_NUM \
    	(ZB_DIMMABLE_LIGHT_IN_CLUSTER_NUM + ZB_DIMMABLE_LIGHT_OUT_CLUSTER_NUM)
    
    /** Number of attribute for reporting on Dimmable Light device */
    #define ZB_DIMMABLE_LIGHT_REPORT_ATTR_COUNT \
    	(ZB_ZCL_ON_OFF_REPORT_ATTR_COUNT + ZB_ZCL_LEVEL_CONTROL_REPORT_ATTR_COUNT)
    
    /** Continuous value change attribute count */
    #define ZB_DIMMABLE_LIGHT_CVC_ATTR_COUNT 1
    
    /** @endcond */ /* internals_doc */
    
    /**
     * @brief Declare cluster list for Dimmable Light device
     * @param cluster_list_name - cluster list variable name
     * @param basic_attr_list - attribute list for Basic cluster
     * @param identify_attr_list - attribute list for Identify cluster
     * @param groups_attr_list - attribute list for Groups cluster
     * @param scenes_attr_list - attribute list for Scenes cluster
     * @param on_off_attr_list - attribute list for On/Off cluster
     * @param level_control_attr_list - attribute list for Level Control cluster
     */
    #define ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(					   \
    	cluster_list_name,							   \
    	basic_attr_list,							   \
    	identify_attr_list,							   \
    	groups_attr_list,							   \
    	scenes_attr_list,							   \
    	on_off_attr_list,							   \
    	level_control_attr_list,						   \
        temp_sensor_attr_list)						   \
    	zb_zcl_cluster_desc_t cluster_list_name[] =				   \
    	{									   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_IDENTIFY,				   \
    			ZB_ZCL_ARRAY_SIZE(identify_attr_list, zb_zcl_attr_t),	   \
    			(identify_attr_list),					   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_BASIC,				   \
    			ZB_ZCL_ARRAY_SIZE(basic_attr_list, zb_zcl_attr_t),	   \
    			(basic_attr_list),					   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_SCENES,				   \
    			ZB_ZCL_ARRAY_SIZE(scenes_attr_list, zb_zcl_attr_t),	   \
    			(scenes_attr_list),					   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_GROUPS,				   \
    			ZB_ZCL_ARRAY_SIZE(groups_attr_list, zb_zcl_attr_t),	   \
    			(groups_attr_list),					   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_ON_OFF,				   \
    			ZB_ZCL_ARRAY_SIZE(on_off_attr_list, zb_zcl_attr_t),	   \
    			(on_off_attr_list),					   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
    		ZB_ZCL_CLUSTER_DESC(						   \
    			ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL,			   \
    			ZB_ZCL_ARRAY_SIZE(level_control_attr_list, zb_zcl_attr_t), \
    			(level_control_attr_list),				   \
    			ZB_ZCL_CLUSTER_SERVER_ROLE,				   \
    			ZB_ZCL_MANUF_CODE_INVALID				   \
    		),								   \
        	ZB_ZCL_CLUSTER_DESC( \
    			ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, \
    			ZB_ZCL_ARRAY_SIZE(temp_sensor_attr_list, zb_zcl_attr_t), \
    			(temp_sensor_attr_list), \
    			ZB_ZCL_CLUSTER_SERVER_ROLE, \
    			ZB_ZCL_MANUF_CODE_INVALID \
        )										\
    }
    
    
    /** @cond internals_doc */
    /**
     * @brief Declare simple descriptor for Dimmable Light device
     * @param ep_name - endpoint variable name
     * @param ep_id - endpoint ID
     * @param in_clust_num - number of supported input clusters
     * @param out_clust_num - number of supported output clusters
     */
    #define ZB_ZCL_DECLARE_HA_DIMMABLE_LIGHT_SIMPLE_DESC(ep_name, ep_id, in_clust_num, out_clust_num) \
    	ZB_DECLARE_SIMPLE_DESC(in_clust_num, out_clust_num);					  \
    	ZB_AF_SIMPLE_DESC_TYPE(in_clust_num, out_clust_num) simple_desc_##ep_name =		  \
    	{											  \
    		ep_id,										  \
    		ZB_AF_HA_PROFILE_ID,								  \
    		ZB_DIMMABLE_LIGHT_DEVICE_ID,							  \
    		ZB_DEVICE_VER_DIMMABLE_LIGHT,							  \
    		0,										  \
    		in_clust_num,									  \
    		out_clust_num,									  \
    		{										  \
    			ZB_ZCL_CLUSTER_ID_BASIC,						  \
    			ZB_ZCL_CLUSTER_ID_IDENTIFY,						  \
    			ZB_ZCL_CLUSTER_ID_SCENES,						  \
    			ZB_ZCL_CLUSTER_ID_GROUPS,						  \
    			ZB_ZCL_CLUSTER_ID_ON_OFF,						  \
    			ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL,					  \
        		ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT, \
    		}										  \
    	}
    
    /** @endcond */ /* internals_doc */
    
    /**
     * @brief Declare endpoint for Dimmable Light device
     * @param ep_name - endpoint variable name
     * @param ep_id - endpoint ID
     * @param cluster_list - endpoint cluster list
     */
    #define ZB_DECLARE_DIMMABLE_LIGHT_EP(ep_name, ep_id, cluster_list)		      \
    	ZB_ZCL_DECLARE_HA_DIMMABLE_LIGHT_SIMPLE_DESC(ep_name, ep_id,		      \
    		ZB_DIMMABLE_LIGHT_IN_CLUSTER_NUM, ZB_DIMMABLE_LIGHT_OUT_CLUSTER_NUM); \
    	ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info## ep_name,		      \
    		ZB_DIMMABLE_LIGHT_REPORT_ATTR_COUNT);				      \
    	ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX(cvc_alarm_info## ep_name,	      \
    		ZB_DIMMABLE_LIGHT_CVC_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_DIMMABLE_LIGHT_REPORT_ATTR_COUNT,			      \
    			reporting_info## ep_name,				      \
    			ZB_DIMMABLE_LIGHT_CVC_ATTR_COUNT,			      \
    			cvc_alarm_info## ep_name)
    
    /** @} */
    
    #endif /* ZB_DIMMABLE_LIGHT_H */
    

    ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(
    	dimmable_light_clusters,
    	basic_attr_list,
    	identify_attr_list,
    	groups_attr_list,
    	scenes_attr_list,
    	on_off_attr_list,
    	level_control_attr_list,
        temp_sensor_attr_list);

    I get the same error when adding a report interval:

    [3.3.2026, 10:43:56] z2m: Request 'zigbee2mqtt/bridge/request/device/reporting/configure' failed with error: 'ZCL command 0x86d79ac5bae41fa3/10 msTemperatureMeasurement.configReport([{"attribute":"measuredValue","minimumReportInterval":60,"maximumReportInterval":3600,"reportableChange":0}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Status 'FAILURE')'

    So I guess it´s the same reason.

    Additional question:
    How should the firmware handle a periodic update when not using the report intervals? Just waiting x second and then publishing the new value?

    Additional informations:
    I´ve checked the Zigbee Weather Station example:

    https://github.com/nrfconnect/sdk-nrf/blob/v2.9.2/applications/zigbee_weather_station/src/main.c
    https://docs.nordicsemi.com/bundle/ncs-2.6.3/page/nrf/applications/zigbee_weather_station/README.html

    I´m a bit more confused because this project uses the same temperature cluster as I use in my modified light bulb but the documentation says that it´s possible to add a binding for periodic notifications.

    So I have to test my sensor with the nRF54L15DK and the Shell application to make sure to fix everything in my project. This leads back to the question why the shell example is complaining about a missing configuration, even if I upload it.

  • Hello,

    Please check how to use the zigbee shell sample here:

    https://docs.nordicsemi.com/bundle/addon-zigbee-r23-latest/page/lib/shell.html#lib-zigbee-shell

    The reason it failed was because you didn't specify what role it was supposed to use.

    Run these commands first:

    bdb role zc (this means "zigbee coordinator". Use bdb role zr for "zigbee router")

    bdb channel 21 (or whatever channel you want to use)

    bdb start.

    See if you can replicate the behavior using the zigbee shell as the coordinator. Then it is easier to say what it is that the Z2M integration tries to do, that is not supported. 

    Initially, we don't support Z2M, but perhaps I can understand what is failing if I can reproduce the issue you are seeing using something that we do support.

    Best regards,

    Edvin

Reply Children
  • Hi Edvin,

    thanks. I found this article already, but I missed the channel command for some reason. I also figured out that the shell example doesn´t work well on the nRF54 because the UART drops characters, etc. I fixed it by using a slower baud rate. Maybe you want to take the issue with you for one of your collegues.

  • Hi  

    I got the shell running and tested my application.

    Shell:

    Runs on nRF5340DK with the following commands

    nvram disable
    -> Done
    bdb role zc
    -> Done
    bdb channel 11
    -> Done
    bdb start
    -> Done
    
    [01:00:26.796,112] <inf> zigbee_app_utils: Device update received (short: 0x98e5, long: 86d79ac5bae41fa3, status: 1)
    

    Then I created a binding for the IAQ, VOC and CO2 clusters without issue

    zdo bind on 86d79ac5bae41fa3 10 f4ce36b2d4c06ca0 64 0x1A0A 0x98e5
    -> Done
    zdo bind on 86d79ac5bae41fa3 10 f4ce36b2d4c06ca0 64 0x1A0B 0x98e5
    -> Done
    zdo bind on 86d79ac5bae41fa3 10 f4ce36b2d4c06ca0 64 0x1A0C 0x98e5
    -> Done

    And I can also read the clusters

    uart:~$ zcl attr read 0x98e5 10 0x1A0A 0x0104 0x0000
    ID: 0 Type: 21 Value: 50
    Done
    [01:10:50.024,078] <inf> zigbee.eprxzcl: Received ZCL command (3): src_addr=0x98e5(short) src_ep=10 dst_ep=64 cluster_id=0x1a0a profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x01 cmd_seq=3 disable_def_resp=1 manuf_code=void payload=[000000213200] (3)
    uart:~$ zcl attr read 0x98e5 10 0x1A0B 0x0104 0x0000
    ID: 0 Type: 21 Value: 0
    Done
    [01:10:55.334,350] <inf> zigbee.eprxzcl: Received ZCL command (4): src_addr=0x98e5(short) src_ep=10 dst_ep=64 cluster_id=0x1a0b profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x01 cmd_seq=4 disable_def_resp=1 manuf_code=void payload=[000000210000] (4)
    uart:~$ zcl attr read 0x98e5 10 0x1A0C 0x0104 0x0000
    ID: 0 Type: 21 Value: 500
    Done
    [01:11:00.429,870] <inf> zigbee.eprxzcl: Received ZCL command (5): src_addr=0x98e5(short) src_ep=10 dst_ep=64 cluster_id=0x1a0c profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x01 cmd_seq=5 disable_def_resp=1 manuf_code=void payload=[00000021f401] (5)
    uart:~$

    But I can´t create reporting for the VOC cluster (33 for uint16_t)

    uart:~$ zcl subscribe on 0x98e5 10 0x1A0B 0x0104 0x00 16 5 20
    Error: Unable to configure attribute 0 reporting. Status: 141
    
    Error: One or more attributes reporting were not configured successfully[01:32:32.295,776] <inf> zigbee.eprxzcl: Received ZCL command (9): src_addr=0x98e5(short) src_ep=10 dst_ep=64 cluster_id=0x1a0b profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x07 cmd_seq=9 disable_def_resp=1 manuf_code=void payload=[8d000000] (9)
    uart:~$ zcl subscribe on 0x98e5 10 0x1A0B 0x0104 0x00 33 5 20
    Error: Unable to configure attribute 0 reporting. Status: 1
    

  • That is great. Are you able to reproduce this on a DK without any external components? Only using the zigbee parts of the application? If so, can you please upload the project here (just zip the application folder and upload it here by dragging and dropping it into the textbox), then I can try to reproduce it locally.

    Best regards,

    Edvin

  • Hi Edvin,

    I prepared a configuration for the nRF54L15DK that uses generated values rather than sensor values.

    You must do the following:

    - Build and flash the app for the nRF54L15DK. Use the debug.conf from "config" to enable the debug mode

    3073.app.zip

    - Build the config (zigbee_config.yaml) with the right address from PM_ZBOSS_PRODUCT_CONFIG_OFFSET in build/<app>/zephyr/include/generated/pm_config.h with

    nrfutil nrf5sdk-tools zigbee production_config zigbee_config.yml zigbee_config.hex --offset <Address>

    - Upload the config

    nrfjprog --program zigbee_config.hex --verify

    - On the Zigbee shell run

    nvram disable
    bdb role zc
    bdb channel 11
    bdb start

    - Reset the nRF54L DK

    - Start with the Zigbee commands

    - You should get this output on the nRF54L15DK

    00> [00:02:00.007,045] <inf> light: 5-minute periodic callback triggered, sampling light sensor...
    
    00> [00:02:00.007,049] <wrn> light: Device is not ready!
    
    00> [00:02:00.007,053] <inf> light: Sending fake data...
    
    00> [00:02:00.007,104] <dbg> app: zbus_on_light_callback: Light value: 10414
    
    00> [00:02:00.007,119] <dbg> app: zbus_on_light_callback: Light min: 0
    
    00> [00:02:00.007,127] <dbg> app: zbus_on_light_callback: Light max: 3011
    
    00> [00:02:10.006,954] <dbg> events: handle_5min_timeout: 5 min timeout
    
    00> [00:02:10.006,979] <wrn> env: Device is not ready!
    
    00> [00:02:10.006,984] <inf> env: Sending fake data...
    
    00> [00:02:10.007,029] <dbg> app: zbus_on_env_callback: Temperature: 3600
    
    00> [00:02:10.007,066] <dbg> app: zbus_on_env_callback: Pressure: 0
    
    00> [00:02:10.007,102] <dbg> app: zbus_on_env_callback: Humidity: 3800
    
    00> [00:02:10.007,115] <inf> light: 5-minute periodic callback triggered, sampling light sensor...
    
    00> [00:02:10.007,119] <wrn> light: Device is not ready!
    
    00> [00:02:10.007,123] <inf> light: Sending fake data...
    
    00> [00:02:10.007,178] <dbg> app: zbus_on_light_callback: Light value: 10792
    
    00> [00:02:10.007,193] <dbg> app: zbus_on_light_callback: Light min: 0
    
    00> [00:02:10.007,200] <dbg> app: zbus_on_light_callback: Light max: 3011
    
    00> [00:02:20.007,013] <dbg> events: handle_5min_timeout: 5 min timeout
    
    00> [00:02:20.007,038] <wrn> env: Device is not ready!
    
    00> [00:02:20.007,043] <inf> env: Sending fake data...
    
    00> [00:02:20.007,089] <dbg> app: zbus_on_env_callback: Temperature: 3900
    
    00> [00:02:20.007,125] <dbg> app: zbus_on_env_callback: Pressure: 0
    
    00> [00:02:20.007,161] <dbg> app: zbus_on_env_callback: Humidity: 4100
    
    00> [00:02:20.007,174] <inf> light: 5-minute periodic callback triggered, sampling light sensor...
    
    00> [00:02:20.007,178] <wrn> light: Device is not ready!
    
    00> [00:02:20.007,182] <inf> light: Sending fake data...
    
    00> [00:02:20.007,237] <dbg> app: zbus_on_light_callback: Light value: 11140
    
    00> [00:02:20.007,252] <dbg> app: zbus_on_light_callback: Light min: 0
    
    00> [00:02:20.007,259] <dbg> app: zbus_on_light_callback: Light max: 3011

    Edit:
    Don´t forget to enable the BME688 in Kconfig / remove the ifdef to use the VOC, IAQ and CO2 cluster. I missed it in my app.

  • Hello,

    Thank you,

    I was able to build and connect to your device, but I was not able to read the attribute, as you described:

    [00:00:00.000,872] <inf> ieee802154_nrf5: nRF5 802154 radio initialized
    *** Booting nRF Connect SDK v2.9.2-4ab7b98fc76f ***
    *** Using Zephyr OS v3.7.99-aa34a5632971 ***
    [00:00:00.008,578] <inf> app: Starting Zigbee R23 shell application
    [00:00:00.008,767] <inf> app: Zigbee R23 shell application started
    uart:~$ bdb role zc
    Zigbee shell does not erase the NVRAM between reboots, but is not aware of the previously configured role.
    Remember to set the coordinator role after rebooting the device.
    Coordinator set
    Done
    uart:~$ bdb channel 21
    Setting channel to 21
    Done
    uart:~$ bdb start
    Started coordinator
    Done
    [00:00:13.863,309] <inf> zigbee_app_utils: Production configuration is not present or invalid (status: -1)
    [00:00:13.863,533] <inf> zigbee_app_utils: Zigbee stack initialized
    [00:00:13.865,561] <inf> zigbee_app_utils: Device started for the first time
    [00:00:13.865,569] <inf> zigbee_app_utils: Start network formation
    [00:00:14.374,291] <inf> zigbee_app_utils: Unimplemented signal (signal: 59, status: 0)
    [00:00:14.374,868] <inf> zigbee_app_utils: Network formed successfully, start network steering (Extended PAN ID: f4ce368b0c20a0f3, PAN ID: 0x97c3)
    [00:00:14.858,785] <inf> zigbee_app_utils: Unimplemented signal (signal: 59, status: 0)
    [00:00:14.859,419] <inf> zigbee_app_utils: Joined network successfully (Extended PAN ID: f4ce368b0c20a0f3, PAN ID: 0x97c3)
    [00:00:23.230,935] <inf> zigbee_app_utils: Device authorization event received (short: 0x2496, long: 86d79ac5bae41f11, authorization type: 3, authorization status: 0)
    [00:00:23.231,157] <inf> zigbee_app_utils: Unimplemented signal (signal: 53, status: 0)
    [00:00:23.231,371] <inf> zigbee_app_utils: Device update received (short: 0x2496, long: 86d79ac5bae41f11, status: 1)
    [00:00:23.415,910] <inf> zigbee_app_utils: New device commissioned or rejoined (short: 0x2496)
    [00:00:24.250,079] <inf> zigbee_app_utils: Unimplemented signal (signal: 53, status: 0)
    [00:00:24.265,098] <inf> zigbee_app_utils: Unimplemented signal (signal: 59, status: 0)
    uart:~$ zdo bind on 86d79ac5bae41f11 10 f4ce368b0c20a0f3 64 0x1A0A 0x2496
    Done
    uart:~$ zdo bind on 86d79ac5bae41f11 10 f4ce368b0c20a0f3 64 0x1A0B 0x2496
    Done
    uart:~$ zdo bind on 86d79ac5bae41f11 10 f4ce368b0c20a0f3 64 0x1A0C 0x2496
    Done
    uart:~$ zcl attr read 0x2496 10 0x1A0A 0x0104 0x0000
    Error: Default Response received;
    Command: 0, Status: 195
    [00:02:34.121,247] <inf> zigbee.eprxzcl: Received ZCL command (0): src_addr=0x2496(short) src_ep=10 dst_ep=64 cluster_id=0x1a0a profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x0b cmd_seq=0 disable_def_resp=1 manuf_code=void payload=[00c3] (0)
    uart:~$ zcl subscribe on 0x2496 10 0x1A0B 0x0104 0x00 16 5 20
    [00:03:23.684,734] <inf> zigbee.eprxzcl: Received ZCL command (1): src_addr=0x2496(short) src_ep=10 dst_ep=64 cluster_id=0x1a0b profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x0b cmd_seq=1 disable_def_resp=1 manuf_code=void payload=[06c3] (1)
    Error: Request timed out
    uart:~$
    

    Are you sure we are running the same application? The only change I did was that I changed the network channel map in the zigbee_conf.yml.

    Best regards,

    Edvin

Related