Skip to main content
Associate
January 25, 2024
Solved

Zigbee identify and groups cluster

  • January 25, 2024
  • 3 replies
  • 12212 views

Hi evryone,

I've been trying to work on Zigbee communication for a while now, so far I've just learned how to read and write attributes. Now I'd like to try to learn how to use cluster Identify and groups, but I dont understand several thing, so I need help. For these cluster I'm working in Server.

Identify Cluster (only IdentifyTime attribute)

so i create my cluster, i allocate it as usual, i use the ZbZclIdentifyServerSetTime function and then i write in my attribute the value of the remaining time. what i don't understand is the part where in my code i'm going to receive the command that says "it's ok i can start the timer". i've seen that there's a start and stop structure that can be used via a callback, but i don't understand how to use it.

 

Groups Cluster 

I don't really understand how to use this one.
I suppose that my device will receive an order to say "I've been added to such and such a group", in which case, as above, how can I manage the reception of this order? How does this cluster server really work?

 

if someone could explain it to me, that would be great!
thanks
have a nice day

This topic has been closed for replies.
Best answer by Ouadi

Hello,

I'm not sure to understand exactly your question about ZbApsmeAddGroupReq which was used in my example to set a group addressing mode using APS layer, but this is not the purpose of the application provided to demonstrate mainly the use of the groups cluster according to your previous request. 
Identification mode is needed only when client use the command ZbZclGroupsClientAddIdentifyingReq, and this was not the case in my example. 

Please find a new example implementing Identify cluster as follow :

  • Initialization of the cluster done inside APP_ZIGBEE_ConfigEndpoints function
  • Set Callback using ZbZclIdentifyServerSetCallback
 /* Idenfity server */
 zigbee_app_info.identify_server = ZbZclIdentifyServerAlloc(zigbee_app_info.zb, SW1_ENDPOINT, NULL);
 assert(zigbee_app_info.identify_server != NULL);
 ZbZclClusterEndpointRegister(zigbee_app_info.identify_server);
 ZbZclIdentifyServerSetCallback(zigbee_app_info.identify_server, ZbZclIdentifyCallback);
  • Set time and enter to identify mode by pressing SW1 button
  • Get current time by pressing SW2 button using ZbZclIdentifyServerGetTime

Regards,

Ouadi

3 replies

Billy OWEN
ST Employee
January 26, 2024

Hi @CH3 

 

The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.

 

Regards,

Billy

Technical Moderator
January 30, 2024

Hello @CH3 ,

Thanks for your post and welcome to the community.

Please find below my answers:

  • Identify Cluster

Identify cluster is used during network commissioning process to allow the identification of each node in the network, this feature is mandatory for Find and Bind process giving the possibility for the device to enter in identify mode.

Identify mode can be done during an interval of time configured using ZbZclIdentifyServerSetTime function as you mentioned, the timer starts automatically once this function is called and the callback ZbZclIdentifyServerSetCallback is raised with ZCL_IDENTIFY_START param.

When the timer expires, the same callback is called to inform that the timer stopped => ZCL_IDENTIFY_STOP

To configure the callback function, you need to call ZbZclIdentifyServerSetCallback function after initialization of the cluster in (APP_ZIGBEE_ConfigEndpoints()).

To get the local identify server time => ZbZclIdentifyServerGetTime function returns the current time.

You can refer to the project example ..\Applications\Zigbee\Zigbee_Find_Bind_Coord that implements this cluster.

  • Groups Cluster

A groups cluster is a feature of APS stack layer providing a mechanism to manage a group of an end point by enabling the transmission of a command to multiple devices through group addressing.

To add an entry in a group table =>  ZbApsmeAddGroupReq 

To remove an entry in a group table => ZbApsmeRemoveGroupReq

To enable the group addressing mode => ZB_APSDE_ADDRMODE_GROUP

To better understand the use of this cluster, you can refer to the project example ..\Applications\Zigbee\Zigbee_OnOff_Client_Router which implements a toggle command sent over a groups cluster.

I hope this will be helpful for you.

Best regards,

Ouadi

 

CH3Author
Associate
January 30, 2024

Hi Ouadi, 

thank you for your reply, it's a great help !

for Groups cluster, what will be the difference between your method (that of  ..\Applications\Zigbee\Zigbee_OnOff_Client_Router ) and the functions taken from the zcl.group.h file? for example, between ZbApsmeAddGroupReq and ZbZclGroupsClientAddReq?
thank you

Technical Moderator
January 30, 2024

APIs listed on my answer uses APS stack layer and could be used independently of ZCL library.

APIs located in file zcl.group.h uses ZCL library and allows to create a group cluster either as a Server or Client with the existing attributes and commands ( add, view, remove..)

BR,

Ouadi

OuadiBest answer
Technical Moderator
February 6, 2024

Hello,

I'm not sure to understand exactly your question about ZbApsmeAddGroupReq which was used in my example to set a group addressing mode using APS layer, but this is not the purpose of the application provided to demonstrate mainly the use of the groups cluster according to your previous request. 
Identification mode is needed only when client use the command ZbZclGroupsClientAddIdentifyingReq, and this was not the case in my example. 

Please find a new example implementing Identify cluster as follow :

  • Initialization of the cluster done inside APP_ZIGBEE_ConfigEndpoints function
  • Set Callback using ZbZclIdentifyServerSetCallback
 /* Idenfity server */
 zigbee_app_info.identify_server = ZbZclIdentifyServerAlloc(zigbee_app_info.zb, SW1_ENDPOINT, NULL);
 assert(zigbee_app_info.identify_server != NULL);
 ZbZclClusterEndpointRegister(zigbee_app_info.identify_server);
 ZbZclIdentifyServerSetCallback(zigbee_app_info.identify_server, ZbZclIdentifyCallback);
  • Set time and enter to identify mode by pressing SW1 button
  • Get current time by pressing SW2 button using ZbZclIdentifyServerGetTime

Regards,

Ouadi

CH3Author
Associate
February 12, 2024

Hello Ouadi
Actually, I now understand how the whole cluster group and Identify system works. What I don't understand is that you activate the Identify cluster by pressing a button, then you check the time from time to time if you press another button, but I would like to activate it because I have received a request. And it's this part, the reception of this request that I don't understand and which is the same as for the cluster group, since in the same way I am sent a request to add as you say. it's the recovery of the request that I don't understand. it's that "zigbee_app_info.identify_server !=NULL" for Identify ? for the cluster group, how do you differentiate between adding or deleting an element? via attributes?

Thanks