Groups Cluster
Cluster ID: 0x0004 |
Endpoint: Typically on Endpoint 1 (application endpoint)
The Groups Cluster manages group membership for devices and is the foundation of Matter multicast messaging. By adding multiple devices to the same Group, commands sent to that Group ID are received by all member devices simultaneously -- for example, "turn off all living room lights at once" is a typical multicast scenario.
Without Groups, controlling 5 lights requires sending 5 individual unicast commands, and latency increases linearly with the number of devices. With Groups, only 1 multicast command is needed, and all members respond almost simultaneously. This is also where the combination of Groups and Scenes delivers the most value -- a single multicast command can make different devices each execute their preset actions (lights to warm tone, curtains half open, AC to 26 degrees).
Commands
The Groups Cluster has 6 commands for managing device group membership. AddGroup, RemoveGroup, and RemoveAllGroups are write operations; ViewGroup and GetGroupMembership are query operations; AddGroupIfIdentifying is a conditional write command (the device must be in Identify mode for it to take effect). Click a command ID in the table below to jump to its detailed description.
| ID | Name | Direction | Description |
|---|---|---|---|
0x00 |
AddGroup | Request / Response | Add the device to a specified group |
0x01 |
ViewGroup | Request / Response | Query the name of a specified group |
0x02 |
GetGroupMembership | Request / Response | Query the list of groups the device belongs to |
0x03 |
RemoveGroup | Request / Response | Remove the device from a specified group |
0x04 |
RemoveAllGroups | Request only | Remove the device from all groups |
0x05 |
AddGroupIfIdentifying | Request only | Add to group only when in Identify mode |
AddGroup -- Add to Group (0x00)
Adds the current device (Endpoint) to a specified Group. If the device is already a member of that group, the command still succeeds (idempotent),
but will update the group name (if the device supports the GN feature).
Returns an AddGroupResponse containing the operation status and GroupID.
| Parameter | Type | Required | Description |
|---|---|---|---|
| GroupID | group-id | Yes | Target Group ID, range 0x0001 ~ 0xFEFF |
| GroupName | string | Yes | Group name (max 16 bytes). Pass an empty string if the device does not support the GN feature |
AddGroupResponse
| Field | Type | Description |
|---|---|---|
| Status | status | 0x00 = SUCCESS, 0x89 = RESOURCE_EXHAUSTED (group table is full) |
| GroupID | group-id | The GroupID from the request, echoed back |
Request example:
{
"invokeRequests": [{
"commandPath": {
"endpointId": 1,
"clusterId": "0x0004",
"commandId": "0x00" // AddGroup
},
"commandFields": {
"0": 1, // GroupID = 0x0001
"1": "Living Room Lights" // GroupName
}
}]
}
Response example:
{
"invokeResponseValue": {
"commandPath": {
"endpointId": 1,
"clusterId": "0x0004",
"commandId": "0x00" // AddGroupResponse
},
"commandFields": {
"0": 0, // Status = SUCCESS
"1": 1 // GroupID = 0x0001
}
}
}
Usage Scenarios
After the user creates a "Living Room" room in the app, the app automatically assigns a GroupID to that room, then sends an AddGroup command to each device in the room to add them all to the same group. When the user taps "Turn off all lights," the app only needs to send one multicast Off command to that GroupID.
ViewGroup -- View Group (0x01)
Queries whether the device belongs to a specified Group, and if so, returns the group's name.
| Parameter | Type | Required | Description |
|---|---|---|---|
| GroupID | group-id | Yes | The Group ID to query |
ViewGroupResponse
| Field | Type | Description |
|---|---|---|
| Status | status | 0x00 = SUCCESS (device belongs to the group), 0x8B = NOT_FOUND (not a member) |
| GroupID | group-id | The GroupID from the request, echoed back |
| GroupName | string | Group name. Only valid when Status = SUCCESS; returns an empty string if the GN feature is not supported |
Usage Scenarios
After the app restores room configurations from the cloud, it sends ViewGroup to each device to confirm whether the group membership is still intact -- if a device lost its group information due to a factory reset, the app needs to re-send AddGroup.
GetGroupMembership -- Query Group Membership (0x02)
Queries which groups a device belongs to in bulk. You can pass a list of GroupIDs for a filtered query, or pass an empty list to retrieve all groups the device belongs to.
The response also includes a Capacity field that indicates how many more groups the device can join.
| Parameter | Type | Required | Description |
|---|---|---|---|
| GroupList | list[group-id] | Yes | List of Group IDs to query. Pass an empty list [] to query all groups the device belongs to |
GetGroupMembershipResponse
| Field | Type | Description |
|---|---|---|
| Capacity | uint8 / null | Number of additional groups the device can join. null means unknown |
| GroupList | list[group-id] | List of Group IDs the device actually belongs to (the intersection of the request list and actual membership; returns all when the request list is empty) |
Request example (query whether the device belongs to groups 1, 2, 3):
{
"invokeRequests": [{
"commandPath": {
"endpointId": 1,
"clusterId": "0x0004",
"commandId": "0x02" // GetGroupMembership
},
"commandFields": {
"0": [1, 2, 3] // GroupList -- query if device belongs to these three groups
}
}]
}
Response example (device belongs to groups 1 and 3, can join 5 more groups):
{
"invokeResponseValue": {
"commandPath": {
"endpointId": 1,
"clusterId": "0x0004",
"commandId": "0x02" // GetGroupMembershipResponse
},
"commandFields": {
"0": 5, // Capacity = 5 (can join 5 more groups)
"1": [1, 3] // GroupList -- device belongs to groups 1 and 3
}
}
}
Usage Scenarios
At app startup, the device's group membership needs to be synchronized: pass an empty GroupList to retrieve all groups the device belongs to, then compare with the room configuration stored in the cloud to handle any added or lost group memberships. The Capacity field can be used to determine whether the device has room to join additional groups.
RemoveGroup -- Remove from Group (0x03)
Removes the device from a specified Group. If the device is not a member of that group, returns NOT_FOUND. After removing the group membership, the device will no longer respond to multicast commands for that group.
| Parameter | Type | Required | Description |
|---|---|---|---|
| GroupID | group-id | Yes | The Group ID to remove the device from |
RemoveGroupResponse
| Field | Type | Description |
|---|---|---|
| Status | status | 0x00 = SUCCESS, 0x8B = NOT_FOUND |
| GroupID | group-id | The GroupID from the request, echoed back |
When removing a group, all Scenes bound to that group are also automatically deleted. If you only want to temporarily stop the device from responding to multicast while keeping the Scene configuration, there is currently no "pause group membership" mechanism -- you can only remove and re-add.
Usage Scenarios
The user moves a light from the "Living Room" to the "Bedroom": The app first sends RemoveGroup (Living Room GroupID) to the light, then sends AddGroup (Bedroom GroupID).
RemoveAllGroups -- Remove from All Groups (0x04)
Removes the device from all joined groups, effectively clearing the group table. Takes no parameters and has no response. Also deletes all associated Scenes.
This command clears all group memberships and all Scenes from the device at once, and cannot be undone. Typically used only during factory reset, device handover, or re-commissioning.
Usage Scenarios
During the factory reset process, the app sends RemoveAllGroups before Remove Fabric to ensure no multicast configuration remains on the device.
AddGroupIfIdentifying -- Add to Group If Identifying (0x05)
Functions the same as AddGroup, but with an added precondition: the device must currently be in Identify mode
(i.e., the Identify Cluster's IdentifyTime > 0) for the command to execute.
If the device is not in Identify mode, the command is silently ignored. There is no response.
| Parameter | Type | Required | Description |
|---|---|---|---|
| GroupID | group-id | Yes | Target Group ID |
| GroupName | string | Yes | Group name (max 16 bytes) |
During commissioning, devices are typically put into Identify mode first (the user confirms "this is the right device"), then AddGroupIfIdentifying is sent via multicast in bulk -- only the device that is currently flashing/beeping will join the group, while other devices are unaffected. This avoids the complex process of obtaining each device's address individually to send unicast AddGroup commands.
Usage Scenarios
Bulk configuration of newly installed light fixtures: the installer triggers Identify on each light one by one (via physical button or scanning a code), then sends the same AddGroupIfIdentifying multicast command in bulk. Each light that is flashing when it receives the command automatically joins the specified group; lights not flashing ignore the command.
Attributes
The Groups Cluster has only one application attribute. Click the attribute ID to jump to its detailed description.
| ID | Name | Type | Access | Description |
|---|---|---|---|---|
0x0000 |
NameSupport | bitmap8 | Read-only | Whether the device supports storing group names |
NameSupport (Name Support)
An 8-bit bitmap indicating whether the device supports storing group names. Currently only Bit 7 (the most significant bit) is used.
| ID | Name | Type | Description |
|---|---|---|---|
0x0000 |
NameSupport | bitmap8 | Bit 7 (0x80): GroupNames -- when 1, the device can store group names. When 0, the GroupName in AddGroup is ignored, and the GroupName in ViewGroup responses is always an empty string |
NameSupport Bitmap
Bit 7 of NameSupport and Bit 0 (GN) of FeatureMap are linked:
if FeatureMap declares GN, then Bit 7 of NameSupport must also be 1.
The two should remain consistent when read.
Feature Bitmap
The Groups Cluster declares optional capabilities supported by the device through FeatureMap (0xFFFC):
Storing group names consumes very few resources (max 16 bytes per group), and the vast majority of Matter devices enable the GN feature. Devices that do not support GN are typically extremely resource-constrained sensor products. The app should check FeatureMap first and not display the group name editing UI when GN is not supported.
Example Data
Reading the Groups Cluster attributes of a device that supports the GN feature:
{
// --- Attributes ---
"0x0000": 128 // NameSupport -- Bit 7 = 1, supports group names
}
The valid GroupID range is 0x0001 ~ 0xFEFF.
0x0000 is invalid, and 0xFF00 ~ 0xFFFF are reserved for internal Matter use.
When assigning GroupIDs, the app must ensure they are within the valid range and that different groups within the same Fabric use different IDs.
Common Scenarios
Scenario 1: Organizing Devices by Room (Most Common)
- The app assigns a unique GroupID to each room (e.g., Living Room = 0x0001, Bedroom = 0x0002)
- When the user drags a device into a room, the app sends
AddGroup(GroupID, RoomName)to the device - When the user taps "Turn off all living room lights," the app sends a single multicast
Offcommand to GroupID 0x0001 - All lights in the living room turn off simultaneously with near-zero latency
Scenario 2: Multi-Device Linked Control
- The user creates a "Theater Mode" group (GroupID = 0x0010) containing a chandelier, LED strip, and motorized curtain
- Send AddGroup to all devices in the group
- When Theater Mode is triggered, send multicast commands to GroupID 0x0010:
- Lights receive
LevelControl.MoveToLevel(20)to dim the brightness - Curtain receives
WindowCovering.GoToLiftPercentage(100)to fully close
- Lights receive
- Note: multicast commands are sent to all devices in the group; each device only executes Cluster commands it supports
Scenario 3: Groups + Scenes Combined (Automation Presets)
Groups and Scenes are the most powerful combination in Matter -- Groups define "which devices act together," and Scenes define "what each device does individually."
- Create a "Living Room" group (GroupID = 0x0001), adding 3 lights and 1 curtain
- Create a Scene "Reading Mode" (SceneID = 0x01) under that group:
- Chandelier: brightness 80%, color temperature 4000K
- Desk lamp: brightness 100%, color temperature 5000K
- LED strip: off
- Curtain: open 50%
- When triggered, send a single
Scenes.RecallScene(SceneID: 0x01)multicast command to GroupID 0x0001 - All devices simultaneously switch to their respective preset states with a single command
Scenario 4: Bulk Group Setup During Commissioning
- The installer puts the target device into Identify mode (by pressing a physical button or triggering via app scan)
- Send
AddGroupIfIdentifying(GroupID, GroupName)to the network multicast address - Only the device that is currently flashing joins the group; other devices ignore the command
- Repeat the above steps for the next device, completing group setup one by one
- This approach is especially suitable for initial deployment of large numbers of devices (e.g., offices, hotels)