You can use the rules engine of IoT Platform to forward data from specified topics to other topics or other Alibaba Cloud services. This article describes how to add topics to a data source.

Background information

When you configure a data forwarding parser, you must associate the parser with topics from which data is forwarded. You can add a maximum of 1,000 topics to each data source.

You can use the topic(n) function in a script to obtain the topic from which data is forwarded. For more information, see Functions supported by the data forwarding feature.

Create a data source

  1. Log on to the IoT Platform console.
  2. On the Overview page, find the instance and click the instance name to go to the Instance Details page.
    Notice Enterprise Edition instances are available only in the Japan (Tokyo) region. If your IoT Platform is not activated in the Japan (Tokyo) region, skip this step.
    Overview
  3. In the left-side navigation pane, choose Rules Engine > Data Forwarding.
  4. On the Data Forwarding page, click Go to New Version in the upper-right corner to go to the new version.
    Note If you have performed this step, the Data Forwarding page of the new version appears after you choose Rules > Data Forwarding.
  5. Click the Data Source tab. On this tab, click Create Data Source.
  6. Enter a data source name and description, and then click OK.
    The name must be 1 to 30 characters in length, and can contain letters, digits, underscores (_), and hyphens (-).
    The Data Source Details page appears. You can click Edit in the upper-right corner to modify the name and description of the data source. Data Source Details
  7. On the Data Source Details page, click Add Topic. In the dialog box that appears, select the topic that you want to process, and then click OK.
    Valid values:
    Table 1. Topics
    Topic Description References
    Custom The topic that is used to forward data of custom formats. The format of this topic is the same as the format of a custom topic. Format: /${productKey}/${deviceName}/user/${TopicShortName}.

    ${TopicShortName} specifies a custom topic category, which indicates the suffix of the custom topic.

    The value can contain wildcard characters, including plus signs (+) and number signs (#).

    • All equipment (+): indicates all devices of the specified product.
    • /user/#: indicates all topics of the specified device.
    Custom topics
    Device Status Change Notification The topic that is used to forward notifications when the status of a device changes between online and offline. Format: /as/mqtt/status/${productKey}/${deviceName}. Submit device status
    TSL Data Reporting The following topics are provided:
    • /${productKey}/${deviceName}/thing/event/property/post: This topic is used to forward device properties.
    • /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/post: This topic is used to forward device events.
    • /${productKey}/${deviceName}/thing/event/property/post: This topic is used to forward multiple device properties at a time.
    • /${productKey}/${deviceName}/thing/event/batch/post: This topic is used to forward multiple device events at a time.
    • /${productKey}/${deviceName}/thing/downlink/reply/message: This topic is used to forward messages that are sent by a device as responses to IoT Platform commands.
    The preceding topics correspond to the following device topics:
    • /sys/{productKey}/{deviceName}/thing/event/property/post: This topic is used to submit device properties.
    • /sys/${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/post and /sys/${productKey}/${deviceName}/thing/event/${tsl.functionBlockId}:{tsl.event.identifier}/post: These topics are used to submit device events.
    • /sys/${productKey}/${deviceName}/thing/event/property/batch/post: This topic is used to submit device properties and events in batches.
    Device Changes Throughout Lifecycle The topic that is used to forward notifications when a device is created, deleted, disabled, or enabled. Format: /${productKey}/${deviceName}/thing/lifecycle Submit lifecycle changes
    Sub-Device Data Report Detected by Gateway The topic that is used to submit and forward the information about a new sub-device when a gateway detects the sub-device. This topic is specific to gateways. Format: /${productKey}/${deviceName}/thing/list/found Submit information about detected sub-devices
    Device Topological Relation Changes The topic that is used to forward notifications when topological relationships between sub-devices and the gateway are created or deleted. This topic is specific to gateways. Format: /${productKey}/${deviceName}/thing/topo/lifecycle. Submit topology changes
    The preceding topic corresponds to the following topic: /sys/{productKey}/{deviceName}/thing/topo/change. This topic is used to submit device data. Notify gateways of changes of topological relationships
    Device tag change The topic that is used to forward notifications when device tags are changed. Format: /${productKey}/${deviceName}/thing/deviceinfo/update. Submit device tag changes
    The preceding topic corresponds to the following topic: /sys/{productKey}/{deviceName}/thing/deviceinfo/update. This topic is used to submit device data. Report tags
    TSL Historical Data Reporting The following topics are provided:
    • /${productKey}/${deviceName}/thing/event/property/history/post: This topic is used to forward historical properties.
    • /${productKey}/${deviceName}/thing/event/${tsl.event.identifier}/history/post: This topic is used to forward historical events.
    The preceding topics correspond to the following topic: /sys/{productKey}/{deviceName}/thing/event/property/history/post. This topic is used to submit historical TSL data. Devices submit historical TSL data to IoT Platform
    Device status notification The following topics are provided:
    • /${productKey}/${deviceName}/ota/upgrade: This topic is used to forward over-the-air (OTA) update results.
    • /${productKey}/${deviceName}/ota/progress/post: This topic is used to forward update progresses.
    The preceding topics correspond to the following topic: /ota/device/progress/${YourProductKey}/${YourDeviceName}. This topic is used to submit update progresses. Submit the update progress to IoT Platform
    Submit a module version number The topic that is used to forward notifications when the version number of an OTA module for a device is changed. Format: /${productKey}/${deviceName}/ota/version/post. Submit OTA module versions
    The preceding topic corresponds to the following topic: /ota/device/inform/${YourProductKey}/${YourDeviceName}. This topic is used to submit the version number of an OTA module. Submit OTA module versions to IoT Platform
    Batch status notification The topic to which IoT Platform sends notifications when the status of an OTA update batch changes. Format: /${productKey}/${packageId}/${jobId}/ota/job/status. Submit the status data of OTA update batches
  8. Optional:Reperform the previous step to add multiple topics to the data source.
    You can delete the added topics on the Data Source Details page based on your business requirements. Topics
  9. Optional:Reperform Step 5 to 8 to add multiple data sources.

What to do next

Create a data destination