Device groups

Updated at:

IoT Platform provides a device grouping feature that lets you classify devices across different products. You can group devices based on specific rules or characteristics, such as function or geographic location. This feature enables unified management and control, which improves management efficiency and device utilization. This topic describes the scenarios for using device groups and explains how to create and manage groups and the devices they contain.

Scenarios

You can group devices based on different dimensions, such as:

  • Function

    Group devices based on their features. For example, you can group all camera devices into one group and all sensor devices into another.

  • Location

    Group devices based on their geographic location. For example, you can group devices located in the same region or building to facilitate the management and monitoring of that area.

  • Purpose

    Group devices based on their business purpose. For example, you can group all security devices into one group and all production devices into another.

  • Business process

    Group devices based on their role in a business process. For example, you can group all input devices into one group and all output devices into another.

After you group devices, you can use the groups in various IoT Platform services:

  • Querying devices managed by groups: You can query device information for different groups in the IoT Platform console or by calling a cloud API. For more information, see View group information and Related API operations in this topic.

  • Data services: You can use data from the device group table and the device group relationship table.

  • Monitoring and Operations and Maintenance (O&M): You can select devices for O&M operations by group.

    • over-the-air (OTA) update: When you create a batch OTA update task, you can choose to upgrade by device group.

    • Device tasks: When you create tasks for device property settings, service invocations, batch message sending, and custom tasks, you can select task objects by device group.

Limits

Device groups are categorized as static or dynamic. The usage and limits are as follows.

Static groups

You first create a group, and then manually add or remove devices from it.

  • Static groups support subgroups and can be nested up to three levels: Parent group > Level-1 subgroup > Level-2 subgroup.

  • Each Alibaba Cloud account can have a maximum of 1,000 groups, including all parent groups and subgroups.

  • A parent group can have a maximum of 100 level-1 subgroups.

  • A subgroup can belong to only one parent group.

  • The nested relationship of a group cannot be modified after it is created. To change the relationship, you must delete the group and then recreate it.

  • You cannot directly delete a group that contains subgroups. You must delete all subgroups before you can delete the parent group.

  • Fuzzy search by group name is supported in group and subgroup lists.

Dynamic groups

When you create a dynamic group, you configure conditional rules to dynamically match and add qualifying devices to the group. You cannot manually add or remove devices from a dynamic group.

  • Currently, only Enterprise Edition instances and new public instances in the China (Shanghai) region support dynamic groups.

  • Dynamic groups are parent groups by default and do not support subgroups.

  • Each Alibaba Cloud account can have a maximum of 10 dynamic groups.

  • When you first create a dynamic group and configure its rules, the rules can match a maximum of 100,000 devices. After the group is created, there is no limit on the number of devices that can be added incrementally.

  • After a dynamic group is created, its dynamic rules cannot be modified.

Create a static group

  1. Log on to the IoT Platform console.

  2. On the Overview page, find the instance that you want to manage and click the instance ID or instance name.

  3. In the navigation pane on the left, choose Devices > Groups. The Groups page appears.

  4. Click Create Group. In the dialog box that appears, set the parameters and click OK.

    Parameter

    Description

    Group Type

    Select Default. This parameter is displayed only for Enterprise instances in the China (Shanghai) region.

    Parent Group

    Select a parent group.

    • Click Group. The group that you create is a parent group.

    • Click a specific group under Group: Create a subgroup under the selected group.

    Group Name

    Specify a name for the group. The group name can contain Chinese characters, English letters, Japanese characters, digits, and underscores (_). The name must be 4 to 30 characters long, and each Chinese or Japanese character counts as two characters.

    Important

    The group name must be unique within your Alibaba Cloud account and cannot be modified after it is created.

    Group Description

    Enter a description for the group.

    After you create a group, you can manage devices and subgroups on the Group Details page. For more information, see Managing devices in a group and Managing static group subgroups.

Create Dynamic Group

  1. In the navigation pane on the left for your instance, select Device Management > Group to open the Group page.

  2. On the Groups page, click Create Group. In the dialog box that appears, complete the dynamic group configuration.

    1. Choose Dynamic in Group Type.

    2. Under Dynamic Rule, enter the query conditions for devices.

      You can click Preview dynamic rules, enter the query conditions under Dynamic Group Condition in the right panel, and then click OK.

      The method for setting query conditions for a group is the same as in the advanced search feature for a device. For more information, see Advanced search.

      Important
      • To search for devices using Thing Specification Language (TSL) model data, you must first configure an index for the TSL model properties. After one minute, you can create a dynamic group based on these properties to retrieve devices.

      • A dynamic group can use a maximum of 100 TSL model properties.

      • When you search for devices using device OTA module data, if the dynamic group is used for dynamic over-the-air (OTA) updates, ota_module.name and ota_module.version must be used together. For more information about OTA updates, see OTA Upgrade Overview.

      动态规则

    3. Input Group Name and Group Description, click OK.

      The group name must be 4 to 30 characters in length and can contain Chinese characters, letters, digits, and underscores (_). A Chinese character is counted as two characters.

      Important

      The group name must be unique within your Alibaba Cloud account and cannot be modified after it is created.

    After a dynamic group is created, it takes up to one minute to take effect. After the group takes effect, the initialization of existing devices can take up to 20 minutes. The dynamic group contains only devices that meet the specified conditions. You can view the list of devices on the Group Details page.

View and manage groups

View group information

  1. On the Device Management > Group page for your instance, click View in the Actions column for the target group.

  2. On the device group details page, you can view and manage group information, devices in the group, and subgroups.

    • On the Group Information tab, you can view the group level, total number of devices, number of online devices, number of activated devices, and group ID.

      On the Group Information tab, you can add tags to the group to use as custom identifiers for flexible management. For more information, see Group Tags.

    • Click the Device List tab, where you can view the devices in a group and add devices to a static group. For more information, see Manage devices in a group in this topic.

    • Click the Subgroup List tab. You can view the subgroups of the group and add new subgroups to it. For more information, see Manage static subgroups in this topic.

      Note

      This operation is supported only for static groups.

Delete a group

Important

Before you can delete a static group, you must first delete all subgroups within it.

  1. On the Device Management > Group page for your instance, click Delete in the Actions column for the target group.

  2. Click Confirm.

Manage devices in a group

Add devices

After you create a static group, you must manually add devices to it.

  1. In the group list on the Device Management > Group page, click View in the Actions column for the group.

  2. On the group details page, click the Device List tab.

  3. Click Add Device To Group, select the check boxes next to the devices that you want to add in the Add Device To Group panel on the right, and click OK.

    You can search for devices by product name or device name. You can also enable Advanced Search in the upper-right corner of the list and download the search results as a CSV file. For more information, see Advanced Search.

    You can click All to view a list of all devices, or click Selected to view a list of selected devices.

    Important
    • You can add a maximum of 1,000 devices at a time.

    • A single group can contain a maximum of 100,000 devices.

    • A device can be added to a maximum of 10 groups.

View devices

  1. On the Device List tab, you can view all devices under All Products, or select a product to view all devices under that product.

    You can enter at least five characters of a device name prefix to perform a fuzzy search. For example, if you enter Dtest, devices with names such as Dtest1, Dtest2, and Dtest3 may be returned.

  2. Click View in the Actions column for the target device to open the device details page, where you can view and manage information such as the device's remarks, tags, Thing Specification Language model data, and files. For more information, see View device information.

Remove devices

If you no longer need to manage a device within a group, you can remove it from the group.

Note

Removing a device from a group does not delete it from IoT Platform.

  1. On the Device List tab, find the device that you want to remove, and click Remove From Group in the Actions column.

  2. Click Confirm.

Manage static subgroups

Use subgroups for more granular device management. For example, under a "Smart Home" group, you can create "Smart Kitchen" and "Smart Bedroom" subgroups to manage kitchen and bedroom devices separately.

  1. In the group list on the Device Management > Group page, click View in the Actions column for the target group.

  2. On the group details page, click the Subgroup List tab.

  3. Click Create Group, select a Parent Group, enter a name and description for the subgroup, and then click Confirm.

  4. Optional: After you create a level-1 subgroup, you can follow the steps above to add a level-2 subgroup.

After you create a subgroup, you can manage the subgroup, its devices, and its level-2 subgroups. For more information, see View and manage groups and Manage devices in a group.

Related API operations

API

Description

CreateDeviceGroup

Creates a static group.

CreateDeviceDynamicGroup

Creates a dynamic group.

DeleteDeviceGroup

Deletes a static group.

DeleteDeviceDynamicGroup

Deletes a dynamic group.

UpdateDeviceGroup

Updates the group description and group type.

QueryDeviceGroupInfo

Queries the details of a group, such as the group name, group ID, and the total number, number of online, and number of activated devices in the group.

QueryDeviceGroupList

Queries a paginated list of groups.

QueryDynamicGroupDevices

Queries the list of devices in a dynamic group.

BatchAddDeviceGroupRelations

Adds devices to a static group.

BatchDeleteDeviceGroupRelations

Removes specified devices from a group.

SetDeviceGroupTags

Adds or updates group tags.

QueryDeviceGroupTagList

Queries a list of group tags.

QueryDeviceGroupByDevice

Queries the list of groups to which a specified device belongs.

QuerySuperDeviceGroup

Queries the information of a parent group based on a subgroup ID.

QueryDeviceListByDeviceGroup

Queries the list of devices in a group.

QueryDeviceGroupByTags

Queries device groups by tags.

Related topics