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, select an environment, find the instance that you want to manage, and click the instance ID or instance name.
    Important This step is required only if Enterprise Edition instances are available. If the Enterprise Edition instances are unavailable in the region that you selected, skip this step. For information about supported regions and instances, see Overview.
    Overview
  3. In the left-side navigation pane, choose Message Forwarding > 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.
    The following table describes the supported topics.
    Table 1. Topics
    TopicDescriptionReferences
    CustomThe 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.
    Use custom topics for communication
    Device Status Change NotificationThe 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 ReportingThe 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 LifecycleThe 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 GatewayThe 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 ChangesThe 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 changeThe 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 ReportingThe 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 notificationThe 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 numberThe 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 notificationThe 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:Repeat Step 5 to Step 8 to create multiple data destinations.

What to do next

Create a data destination