Updated on 2024-01-17 GMT+08:00

Group

Overview

A group is a collection of devices. You can create groups for all the devices in a resource space based on different rules, such as regions and types, and you can operate the devices by group. For example, you can perform a firmware upgrade on a group of water meters in the resource space. Devices in a group can be added, deleted, modified, and queried. A device can be bound to and unbound from multiple groups.

Classification

Table 1 Classification

Group Type

Description

Static group

Manually add devices to or remove devices from a group. Group nesting is supported.

Restrictions:

  • A maximum of 1,000 groups (including nested sub-groups) can be created for a single instance of an account.
  • A maximum of 20,000 devices can be added to a group.
  • A device can be bound to a maximum of 10 groups.
  • A maximum of five groups can be nested.
  • A sub-group can belong to only one parent group.
  • If a group has sub-groups, the group cannot be deleted directly. You need to delete the sub-groups first before deleting the parent group.

Dynamic group

Devices that meet the conditions are automatically added to the group based on the dynamic group rules (device query and SQL-like statements). Devices that do not meet the conditions are automatically removed from the group. Devices in a group cannot be manually managed.

Restrictions:

  • A maximum of 10 dynamic groups can be created for a single instance of an account.
  • When a dynamic group is created for the first time, a maximum of 100,000 devices can be matched. (There is no limit on the number of devices that can be added to the dynamic group.)
  • Dynamic groups are parent groups by default. Dynamic groups cannot be nested.
  • After a dynamic group is created, the rules of the dynamic group cannot be modified.
  • Devices in a dynamic group cannot be manually managed.
  • This API is supported only by Standard and Enterprise editions.
  • The maximum TPS for an account to create a dynamic group is 1 (one request per second).

Managing Groups

  1. Access the IoTDA service page and click Access Console.
  2. In the navigation pane, choose Devices > Groups.
  3. You can add, modify, or delete a group.

Static Group

  1. Access the IoTDA service page and click Access Console.
  2. In the navigation pane, choose Devices > Groups.
  3. Click Add Root Group to add a group. Set group type to Static Group, set parameters as prompted, and click OK.

    Figure 1 Adding a static group

  4. On the static group details page, you can bind or unbind devices in the group. For details, see Table 2.

    Figure 2 Binding a device to a static group
    Table 2 Description

    Operation

    Description

    Binding

    Click Bind to bind a device to a group.

    Batch unbinding

    Select multiple devices (up to 100 devices can be selected at a time) and click Batch Unbind to unbind selected devices from the current group.

    Unbinding

    Locate the target device and click Unbind to unbind the device from the group.

  5. You can choose Devices > Device Details > Groups to view information about the group to which the device is added and perform management operations. For details, see Table 2.

    Figure 3 Single device group management

Dynamic group

  1. Access the IoTDA service page and click Access Console.
  2. In the navigation pane, choose Devices > Groups.
  3. Click Add Root Group to add a group. Set group type to Dynamic Group.
  4. Set parameters as prompted, enter SQL-like statements for dynamic rules, and click Try to view the matched devices. Click OK to complete the dynamic group creation.

    Figure 4 Adding a dynamic group

    • For details about the dynamic rule syntax, see Advanced Search.
    • The difference between dynamic group rules and advanced search is that dynamic group rules do not support app_id and group_id filtering.
    • You can click Try to enter a dynamic rule. After you enter a dynamic rule, click OK. The rule is automatically written back.

Example Scenario

Create a dynamic group based on the device name fuzzy match rule (other conditions can be selected based on the site requirements) and select the dynamic group to execute the OTA upgrade task.

Devices in a dynamic group are dynamically adjusted based on device names, and the status of the OTA upgrade task associated with the dynamic group also changes dynamically.

For details, see Upgrading the Firmware for a Batch of Devices and Dynamic Group.

  1. Create a dynamic group named HuaweiDeviceGroup and set the group rule to device_name like'HuaweiDevice %'.
    Figure 5 Dynamic group details
  2. Create a device firmware upgrade task and select the dynamic group HuaweiDeviceGroup.
    Figure 6 Firmware upgrade task
  3. After the dynamic group is created, you can view that the devices in the dynamic group are added to the upgrade task.
    Figure 7 Task details
  4. Register a device by referring to Registering a Single Device. The device name is HuaweiDevice011. After the registration is successful, you can view that the device has been automatically added to the dynamic group HuaweiDeviceGroup.
    Figure 8 Dynamic group details
  5. View the sub-task details of the software and firmware upgrade task. You can see that the device has been automatically added to the upgrade task.
    Figure 9 Firmware upgrade task
  6. On the HuaweiDevice001 details page, change the device name to AbandonedHuaweiDevice001.
    Figure 10 Device details page
  7. After the device name is changed successfully, the device is automatically removed from the HuaweiDeviceGroup dynamic group.
    Figure 11 Dynamic group details
  8. View the sub-task details of the software and firmware upgrade task. The upgrade status of the device is Removed.
    Figure 12 Firmware upgrade task