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

Groups in Zigbee - how to deal with group commands.

I have inserted the groups cluster at an endpoint.  Yet, and eventhough a group seems to be additioned to the device (the device responds with 0 to the add group command from the network), no group commands are executed.  As ZBoss does not provide the source, I can debug no further.

Several messages seem to go to zboss_signal_handler upon firing a group command from a client, but it does not seem to have a whole lot of information (just the signal number and status).

How do I:

  1) Check which groups are added to the ZCL Groups cluster at the device (and from the same device)?

  2) Do I have to initialise the group cluster myself, using zb_zcl_groups_init_server()?

  2) Process a group command to a device which is a member of such group?  Do I have to take care of them specifically, calling zb_zcl_process_groups_commands_srv()?

  Thanks in advance.

  • Hi,

    The light control example has support for ZCL Groups functionality, so I would recommend taking a look at that to see how it is implemented there. The light bulb example is the same as the one in the normal light control example, but you should use light switch with groups instead for the light switch, which can be found in examples/zigbee/experimental/light_control/light_switch_groups. For more information you can see the light control example documentation.

    Q1

    For this you can use the get group membership command, which can be used by a device to inquire about the group membership of the device receiving the get group membership command. En example of what this command can look like is:

    ZB_ZCL_GROUPS_INIT_GET_GROUP_MEMBERSHIP_REQ(zcl_cmd_buf, cmd_ptr, ZB_ZCL_ENABLE_DEFAULT_RESPONSE, 1);
    ZB_ZCL_GROUPS_ADD_ID_GET_GROUP_MEMBERSHIP_REQ(cmd_ptr, TEST_GROUP_ID_1);
    ZB_ZCL_GROUPS_SEND_GET_GROUP_MEMBERSHIP_REQ(zcl_cmd_buf, cmd_ptr, DST_ADDR, DST_ADDR_MODE, DST_ENDPOINT,
                                                HA_SWITCH_ENDPOINT, ZB_AF_HA_PROFILE_ID, NULL);

    When the other device receives the get group membership command, they will respond with a get group membership response command. This contains capacity, group count, and group list, where group list is a list of the identifiers of the groups in the group table. This command can be parsed as follows:

    ZB_ZCL_GROUPS_GET_GROUP_MEMBERSHIP_RES(buf, group_member_res);

    Q2

    You should not have to initialize the group cluster.

    Q3

    I am not certain whether you mean a group command as in one of the possible ZCL commands in the Groups cluster, or if you mean a cluster command from another cluster that is sent to a group, but I will answer both. 

    For the first, one of the commands in the Groups cluster (add group, view group, get group membership, remove group, remove all groups, remove group if identifying), then you can handle them as the examples in our documentation. These are similar to the one I added above regarding the get group membership command. You will find examples of how to use these commands in the API for the specific command here.

    If you instead meant a regular cluster command that is sent to a group, such as a light switch sending an ON/OFF command to a light bulb group, then you should not have to do anything specific when handling that command. It should be handled as a normal ON/OFF command.

    Best regards,

    Marte

Related