Tags

更新时间:
复制 MD 格式

Assign custom tags to products, devices, and groups to categorize resources with shared characteristics. Tags simplify searching, aggregating, and managing IoT resources at scale.

Usage notes

Tag

Description

product tag

Describes attributes shared by all devices under the same product.

For example, you can use tags to identify a product's manufacturer, organization, physical dimensions, or operating system.

device tag

Identifies a device by a specific characteristic, enabling you to categorize, aggregate, and analyze devices for unified management.

For example, you can assign the tag room:201 to a smart meter in Room 201.

group tag

Describes attributes shared by devices and subgroups within a group, enabling cross-product device management.

For example, you can tag the region or space where the devices in a group are located.

Use cases

Perform batch operations using tags

Tag

Example operation

product tag

Find products that share common attributes within an IoT Platform instance based on their tags.

device tag

After searching for target devices based on their tags, you can perform the following batch operations:

  • Enable, disable, or delete devices. For more information, see Disable and enable devices and Delete a device.

  • When managing device groups or performing device OTA updates, you can use the Advanced Search feature to quickly filter devices by specific tags and add them to the target group or OTA update task. For more information, see Advanced search.

group tag

Find groups and subgroups that share common attributes within an IoT Platform instance based on their tags.

Manage tags from devices

After you implement tag management on your devices, they can perform the following operations:

  • Report tags: When a device reports its tags, IoT Platform automatically adds or updates the corresponding device tags in the console.

  • Delete tags: A device sends a request to delete its tags, and IoT Platform removes them upon receipt.

  • Query tags: A device sends a request to query its tags, and IoT Platform returns the requested information upon receipt.

IoT Platform's multilingual device-side Link SDK integrates the tagging feature and transmits tag information within the system. For device-side Link SDK code samples, see Device tags for device development. For the topics and data formats used to manage tags, see Alink protocol for device tags.

Forward tag change information

With message forwarding, IoT Platform sends messages about device tag operations (add, update, delete, and clear) to your application server or other Alibaba Cloud services. For more information about configuring message forwarding, see Message forwarding. For the forwarded data format, see Device tag changes.

Prerequisites

  1. You have logged on to the IoT Platform console.

  2. Before you add tags, create the corresponding product, device, or group. For more information, see the following topics:

Background information

Managing numerous IoT devices often requires differentiating and batch-processing them. IoT Platform addresses this with its tagging feature. Assign tags to products, devices, and groups, then categorize and manage them based on these tags.

Limits

  • Tags for products, devices, and groups are key-value pairs in the Key:Value format.

  • The tag key abc is reserved by IoT Platform. Do not set a tag Key to abc. If you set Key=abc, the tag is automatically filtered out during tag-based searches.

  • Tag keys are case-insensitive. However, IoT Platform and the data forwarded using the message forwarding feature always use the original casing of the tag key.

    Even if you delete a tag and then re-add it with only a change in case, the key in forwarded data retains the original casing.

    For example, if you create a tag ssid:1000 and later update it by using Ssid:1001, the Value is successfully updated to 1001, but the data forwarded by the system still uses ssid:1001.

  • Each product, device, or group can have a maximum of 100 tags.

Edit tags in the console

Edit product tags

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

  2. In the left navigation bar, select Devices > Product.

  3. On the Products page, find the product that you want to tag, and click View in the corresponding Actions column.

    The Tag Information section displays all tags for the product.

  4. Click Edit to the right of Tag Information.

  5. In the Edit Tag dialog box, enter the Tag Key and Tag Value.

    Click Delete to remove an existing tag, or click + Add Tag to add a new one.

    Parameter

    Description

    tag key

    Must be 1 to 30 characters in length and can contain letters, digits, and periods (.).

    tag value

    Must be up to 128 characters in length and can contain Chinese characters, Japanese characters, letters, digits, underscores (_), hyphens (-), colons (:), and periods (.). Each Chinese or Japanese character counts as two characters.

  6. (Optional) Click Add Tag to add more tags, or click Delete to remove unwanted tags.

  7. Click Confirm.

Edit device tags

  1. In the left navigation bar of the target instance, select Devices > Device.

  2. On the Device page, click View for the device you want to tag.

    The Tag Information section displays all tags for the device.

  3. On the Device Details page, click Edit to the right of Tag Information.

  4. In the Edit Tag dialog box, click Add Tag and enter the tag key and tag value.

    Parameter

    Description

    tag 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

    Must be up to 128 characters in length and can contain Chinese characters, Japanese characters, letters, digits, underscores (_), hyphens (-), number signs (#), at signs (@), percent signs (%), ampersands (&), colons (:), and periods (.). Each Chinese or Japanese character counts as two characters.

  5. Optional: In the Edit Tag dialog box, click the Geographical Location Tag text box, and select a location from the pop-up map, where you can search by address.

    Important

    A geographical location tag marks the physical location of a device and uses the format coordinate:${longitude}:${latitude}.

    If the Thing Specification Model of the product to which the device belongs includes a GeoLocation attribute, setting a geographical location tag in the console synchronizes this information with the GeoLocation attribute value. However, location information set through server-side APIs or reported by the device is not synchronized to the GeoLocation attribute.

  6. (Optional) Click Add Tag to add more tags, or click Delete to remove unwanted tags.

  7. Click Confirm.

Edit group tags

  1. In the left navigation bar of the target instance, select Devices > Group.

  2. On the Groups page, find the group to which you want to add tags, and click View in the corresponding Actions column.

    The Group Tags section displays all tags for the group.

  3. Click Edit to the right of Tag Information.

  4. Optional: In the Edit Tag dialog box, click the text box for the geographical location tag. In the map that appears, select a location. You can search by address.

    Note

    A geographical location tag marks the physical location of a device and uses the format coordinate:${longitude}:${latitude}.

  5. In the Edit Tag dialog box, enter the Tag Key and Tag Value.

    Click Delete to remove an existing tag, or click + Add Tag to add a new one.

    Parameter

    Description

    tag key

    Must be 1 to 30 characters in length and can contain letters, digits, and periods (.).

    tag value

    Must be up to 128 characters in length and can contain Chinese characters, Japanese characters, letters, digits, underscores (_), hyphens (-), colons (:), and periods (.). Each Chinese or Japanese character counts as two characters.

  6. (Optional) Click Add Tag to add more tags, or click Delete to remove unwanted tags.

  7. Click OK.

Manage tags with server-side APIs

IoT Platform provides server-side APIs to manage tags in batches and query products, devices, and groups by their tags.

Product tags

Feature

API

Description

Edit tags

CreateProductTags

Creates product tags.

UpdateProductTags

Updates product tags.

DeleteProductTags

Deletes product tags.

Query tags

ListProductTags

Queries all tags of a product.

Use tags

ListProductByTags

Queries products by tag.

Device tags

Feature

API

Description

Edit tags

SaveDeviceProp

Sets device tags.

DeleteDeviceProp

Deletes device tags.

Query tags

QueryDeviceProp

Queries the tag list of a specified device.

Use tags

QueryDeviceByTags

Queries devices by tag.

Group tags

Feature

API

Description

Edit tags

SetDeviceGroupTags

Adds, updates, or deletes group tags.

Query tags

QueryDeviceGroupTagList

Queries the tag list of a group.

Use tags

QueryDeviceGroupByTags

Queries device groups by tag.