You can use custom tags to identify products, devices, and groups. This allows you manage the resources with high flexibility. This topic describes how to attach a tag.

Prerequisites

A product, a device, and a device group are created. For more information, see the following articles:

Background information

In IoT-related scenarios, you may need to manage a large number of products and devices. You may face a challenge when you need to identify various products and devices and manage the resources. Alibaba Cloud IoT Platform provides tags to address this issue. You can attach different tags to products, devices, or device groups and manage the resources based on the tags.

Usage notes and limits

  • The format of a tag is Key:Value.
    Notice abc is a key that is reserved by IoT Platform. You cannot set a key to abc. If you set a key to abc, the key is automatically filtered when you query tags.
  • Each product, device, or device group can have up to 100 tags.

Add product tags

A product tag indicates common information about all devices of a product, such as the manufacturer, organization, physical size, and operating system of the product.

  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 name to go to the Instance Details page.
    Notice Enterprise Edition instances are available in the China (Shanghai) and Japan (Tokyo) regions. If the Enterprise Edition instances are unavailable in the region that you select, skip this step.
    Overview
  3. In the left-side navigation pane, choose Devices > Products.
  4. On the Products page, find the product to which you want to add a tag and click View in the Actions column.
  5. Click Edit to the right of Tag Information.
    Product tags
  6. In the Edit Tag dialog box, set the Tag key and Tag value parameters. Then, click OK.
    Parameter Description
    Tag key The key of the tag. The key must be 1 to 30 characters in length and can contain letters, digits, and periods (.).
    Tag value The value of the tag. The value must be 1 to 128 characters in length and can contain letters, digits, underscores (_), hyphens (-), colons (:), and periods (.).

Add device tags

You can add unique tags to devices based on device features. This allows you to manage your devices with ease. For example, you can add the room:201 tag to a smart meter in Room 201.

  • You can forward device tags in IoT Platform. For more information about data formats, see Device tags.
  • You can also add a device tag to the body of a message that is sent by the device. Then, you can send the message to other Alibaba Cloud services by using the data forwarding feature of the rules engine. For more information about data formats, see Submit device tag changes.
  1. In the left-side navigation pane, choose Devices > Devices.
  2. On the Devices page, find the device to which you want to add a tag and click View in the Actions column.
  3. On the Device Details page, click Edit to the right of Tag Information.
    Device tags
  4. In the Edit Tag dialog box, click Add Tag and set the Tag key and Tag value parameters.
    Parameter Description
    Tag key The key of the tag. The key must be 1 to 30 characters in length and can contain letters, digits, forward slashes (/), underscores (_), hyphens (-), number signs (#), at signs (@), percent signs (%), ampersands (&), asterisks (*), and periods (.).
    Tag value The value of the tag. The value must be 1 to 128 characters in length and can contain letters, digits, Japanese characters, underscores (_), hyphens (-), number signs (#), at signs (@), percent signs (%), ampersands (&), colons (:), and periods (.).
  5. Click OK.

Add group tags

Device groups are used to manage devices across products. A group tag indicates common information about all devices and subgroups of a device group, such as the region and location where the devices reside.

  1. In the left-side navigation pane, choose Devices > Groups.
  2. On the Groups page, find the device group to which you want to add a tag and click View in the Actions column.
  3. Click Edit to the right of Tag Information.
    Device group tags
  4. In the Edit Tag dialog box, set the Tag key and Tag value parameters. Then, click OK.
    Parameter Description
    Tag key The key of the tag. The key must be 1 to 30 characters in length and can contain letters, digits, and periods (.).
    Tag value The value of the tag. The value must be 1 to 128 characters in length and can contain letters, digits, underscores (_), hyphens (-), colons (:), and periods (.).

Manage multiple tags at a time

You can create, edit, and delete tags in the IoT Platform console. You can also call the API operations provided by IoT Platform to manage tags or query products, devices, and groups based on tags. For more information, see List of operations by function.