Updated on 2024-11-06 GMT+08:00

Groups and Tags

Group Introduction

A device group is a collection of devices. You can create groups for all the devices in a resource space based on rules (such as regions and types), and operate these 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.

Table 1 Classification

Group Type

Description

Static group

You need to manually add devices to or remove devices from a group. Group nesting is supported.

Restrictions:

  • A maximum of 1,000 groups (including nested child 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 group layers are supported.
  • A child group can belong to only one parent group.
  • If a group has child groups, the group cannot be deleted directly. You need to delete the child groups before deleting the parent group.

Dynamic group

Devices are automatically added to or removed from the group based on the dynamic query rules of SQL-like statements. You cannot manually manage devices in a dynamic group.

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 later.)
  • Dynamic groups are parent groups by default. Dynamic groups cannot be nested.
  • After a dynamic group is created, its rules 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. Click the target instance card.
  2. In the navigation pane, choose Devices > Groups.
  3. You can add, modify, or delete a group.

    Figure 1 Device - Group

Static Group

  1. Access the IoTDA service page and click Access Console. Click the target instance card.
  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 2 Group - Creating a static group

  4. Access the static group details page. Bind or unbind devices in the group. For details, see Table 2.

    Figure 3 Static group - Binding a device
    Table 2 Description

    Operation

    Description

    Binding

    Click Bind to bind a device to a group.

    Batch unbinding

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

    Unbinding

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

  5. In the navigation pane, choose Devices > All Devices. On the displayed page, locate the target device, click View in the Operation column. Click the Groups tab page to check and manage the associated groups. For details, see Table 2.

    Figure 4 Device - Group management

Dynamic group

  1. Access the IoTDA service page and click Access Console. Click the target instance card.
  2. In the navigation pane, choose Devices > Groups.
  3. Click Add Root Group to add a group. Set Group Type to Dynamic.
  4. Set parameters as prompted, enter SQL-like statements, and click Configure Rule to check the matched devices. Click OK to complete the dynamic group creation.

    Figure 5 Group - Creating 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.

Dynamic Group Example

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 6 Dynamic group - Details

  2. Create a device firmware upgrade task and select the dynamic group HuaweiDeviceGroup.

    Figure 7 Creating a firmware upgrade task - Dynamic group

  3. After the dynamic group is created, you can view that the devices in the dynamic group are added to the upgrade task.

    Figure 8 Firmware upgrade task - Details (dynamic group)

  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 9 Dynamic group - Adding a device

  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 10 Firmware upgrade task - Adding a device to a dynamic group

  6. On the HuaweiDevice001 details page, change the device name to AbandonedHuaweiDevice001.

    Figure 11 Device - Changing device name

  7. After the device name is changed successfully, the device is automatically removed from the HuaweiDeviceGroup dynamic group.

    Figure 12 Dynamic group - Removing a device

  8. Check the sub-task details of the software and firmware upgrade task. The upgrade status of the device is Removed.

    Figure 13 Firmware upgrade task - Removing a device from a dynamic group

Tags

Tags are used to classify devices. You can bind tags to devices on the device details page to manage devices.

  1. Access the IoTDA service page and click Access Console. Click the target instance card.
  2. In the navigation pane, choose Devices > All Devices. On the displayed page, locate the target device, and click View in the Operation column to access its details page.
  3. On the Tags tab page, click Bind Tags to bind one or more tags to the device.

    Figure 14 Device - Binding a tag

Tag-related APIs

Binding Tags

Unbinding Tags