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
- Log on to the IoT Platform console.
- On the Overview page, find the instance that you want to manage and click the instance name to go to the Instance Details page. Important 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.
- In the left-side navigation pane, choose .
- 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.
- Click the Data Source tab. On this tab, click Create Data Source.
- 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.
- 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 is the suffix of the custom topic.The value can contain wildcard characters, including plus signs (+) and number signs (#).
- All equipment (
+
): all devices of the specified product. /user/#
: 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 switches 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 following topics are used to submit raw device data: /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 multiple device properties and events at a time.
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 provided for 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 provided for gateways. Format: /${productKey}/${deviceName}/thing/topo/lifecycle
.Submit changes in topological relationships /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 /sys/${productKey}/${deviceName}/thing/deviceinfo/update
. This topic is used to submit device data.Submit 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.
/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.
/ota/device/progress/${productKey}/${deviceName}
. 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 /ota/device/inform/${productKey}/${deviceName}
. 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 - All equipment (
- 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.
- Optional:Reperform Step 5 to 8 to add multiple data sources.