Hello,
I want to make a custom cluster in a router that will contain a custom writable attribute. And I want to be able to modify that attribute from the coordinator. What are the steps to achieve this?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I want to make a custom cluster in a router that will contain a custom writable attribute. And I want to be able to modify that attribute from the coordinator. What are the steps to achieve this?
Hello Panagiotis,
Although manufacturer-specific clusters/attributes/commands are not supported inside TI's ZCL by default, here is a relevant E2E post that addresses how to add this feature manually to enable this requirement: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/870940
Regards,
Ryan
Ryan Brown1 I remember you had a SimpleLink academic article for this topic in old CC26x2 SDK but the link doesn’t work now. Since this is a frequent asked topic, will you bring the guide back?
Hello YK,
Even before the Designing a Custom Zigbee 3.0-Certifiable Product Using SampleApp SLA, the article used GenericApp as a basis with clusters/commands/attributes already supported in TI's ZCL, not manufacturer-specific implementations. This prior guide supported an antiquated SDK which has been removed from TIREx and TI has not further investigated the addition of manufacturer-specific designs.
Regards,
Ryan
Maybe I remember this incorrectly but I think TI should consider providing guide to do this
So I should implement the code from these two threads:
The two zcl files from this thread:
And the bdb_reporting file from this:
Is this right?
Also I defined a custom cluster and attribute
{
ZCL_CLUSTER_ID_CUSTOM_PANAGIOTIS,
{ // Attribute record
ATTRID_PANAGIOTIS,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE | ACCESS_REPORTABLE,
(void *)&zclSampleLight_Custom
}
},
{
ZCL_CLUSTER_ID_CUSTOM_PANAGIOTIS,
{ // Attribute record
ATTRID_CLUSTER_REVISION,
ZCL_DATATYPE_UINT16,
ACCESS_CONTROL_READ,
(void *)&zclSampleLight_custom_clusterRevision
}
},
and this is how they are showing

Does the reason of them not showing their true names have anything to do with the fact that custom clusters/attributes are not supported by default, or is it something else?
What do you mean the reason of them not showing their true names? If you mean why it doesn't show PANAGIOTIS, it is due to your parser cannot recognize custom cluster/attributes.
Yes, you are right. Up until now the only thing that I have done is to define a cluster and an attribute. With this I can write and read the attribute. I will continue on it to see if it has full functionality. I will report if I have to do anything else to make it work
Here is the code that I have implemented till now: https://drive.google.com/file/d/1_J4yzBdjw_mMgw-gDI9-y-9yJ8gzPkQG/view?usp=sharing
I also implemented the code found here in ZR_Light: WEBENCH® Tools/CC2652R: some improvement for z-stack's zcl.c - Zigbee & Thread forum - Zigbee & Thread - TI E2E support forums
And the code from this (second method): WEBENCH® Tools/CC2652R: How to make z-stack to support manufacturer-specific-cluster, manufacturer-specific-attribute and manufacturer-specific-command - Zigbee & Thread forum - Zigbee & Thread - TI E2E support forums
I can't get the code to enter: static ZStatus_t zclGeneral_HdlIncoming( zclIncoming_t *pInMsg ) in ZR_Light
Am I missing something?
Do you have anything to suggest?
The code you've referenced does not show zclGeneral_HdlIncoming? Does your code call zclGeneral_RegisterUnsupportCallback to register zclGeneral_HdlIncoming and what are your start/end Cluster IDs of the zcl_registerPlugin as compared to your ZCL_CLUSTER_ID_CUSTOM_PANAGIOTIS value?
Regards,
Ryan
I made some changes to zclGeneral_HdlIncoming
static ZStatus_t zclGeneral_HdlIncoming( zclIncoming_t *pInMsg )
{
ZStatus_t stat = ZSuccess;
if ( zcl_ClusterCmd( pInMsg->hdr.fc.type ) )
{
// Is this a manufacturer specific command?
stat = ZFailure;
if ( pInMsg->hdr.fc.manuSpecific == 0 )
{
if ( zcl_matchClusterId( pInMsg ) ) //match cluster ID support.
{
stat = zclGeneral_HdlInSpecificCommands( pInMsg );
}
else
{
stat = ZFailure;
}
}
else
{
// We don't support any manufacturer specific command.
stat = ZFailure;
}
if( stat == ZFailure)
{
if( zclGenUnsupportCallback )
{
stat = zclGenUnsupportCallback( pInMsg );
}
}
}
else
{
// Handle all the normal (Read, Write...) commands -- should never get here
stat = ZFailure;
}
return ( stat );
}
and I changed the end cluster id of the zcl_registerPlugin in zclGeneral_RegisterCmdCallbacks and zclGeneral_RegisterUnsupportCallback to include my cluster id.
I also removed the code that I took from WEBENCH® Tools/CC2652R: How to make z-stack to support manufacturer-specific-cluster, manufacturer-specific-attribute and manufacturer-specific-command - Zigbee & Thread forum - Zigbee & Thread - TI E2E support forums as it wasn't used anywhere
Now it works except when I turn on the led, my attribute changes its value to whatever it was + 256 and when I turn it off it reverts back to its original value.
If you see my code that I send I don't think that on/off intervenes with my code. I also checked the on/off code but there isn't anything wrong there. Why is this happening?
Further debug the project to determine exactly what function is changing your attribute value (I'm assuming you are referring to zclSampleLight_Custom) by 256, then figure out the correlation between the Light application and your custom code. ZCL_CLUSTER_ID_CUSTOM_PANAGIOTIS and ATTRID_PANAGIOTIS should not overlap with any other cluster/attribute ID values saved on SAMPLELIGHT_ENDPOINT, perhaps you could consider registering a second endpoint instead.
Regards,
Ryan
I fixed it by moving zclSampleLight_Custom = counter; from zclSampleLight_updateCustomAttribute() to zclSampleLight_CustomCB().
Everything is working as expected now.
Thank you for your help!!!
You should add manufacture-code for your custom-clusters, you can download my SDK https://gitee.com/zigbee_luo/simplelink_sdk_2022.git and cover the current SDK 6.20 folder
And you should define the ZDO_MANU_CODE value as your manufacture-code in your project. If the cluster-id is over than 0xFC00, the manufacture-code will be matched when your node receives ZCL-frame.
In my SDK, you can send any ZCL-command(Read Attr, Write Attr, Specific-cmd...) which includes manufacture-code as your wanting.