In this best practice, temperature sensors are monitored. This article describes how to create a temperature sensor product and devices in the IoT Platform console. This topic also describes how to define a Thing Specification Language (TSL) model and create a data forwarding rule.

Procedure

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Devices > Products. On the page that appears, click Create Product to create a product. For more information, see Create a product.
  3. Define a feature.
    1. On the Product Details page, click the Define Feature tab. Click Edit Draft and then Add Self-defined Feature to define a temperature property for the product.
    2. After the feature is added, click Release online to publish the TSL model.
  4. In the left-side navigation pane, choose Devices > Devices. On the page that appears, click Batch Add to add multiple devices.
    In this example, you need to add 5,000 devices. You can add a maximum of 1,000 devices at a time. Therefore, you must add devices a minimum of five times. For more information, see Create multiple devices at a time.
  5. In the left-side navigation pane, choose Rules > Data Forwarding. On the page that appears, create a data forwarding rule to allow forwarding of the temperature data reported by the temperature sensor to Function Compute.
    1. Click Create Rule to create a rule that processes JSON-formatted data.
    2. Click View to go to the details page of the rule and write an SQL statement to process data.

      The SQL statement in this example filters data from the reported property data. The SQL statement returns the values of the deviceName and Temperature fields when the temperature is higher than 25°C. The two fields are forwarded to Function Compute.

    3. Add a data forwarding operation and set the data forwarding destination to Function Compute.
    4. After the rule configuration is complete, return to the Data Forwarding page and click Start to enable the rule.
    For more information, see Configure data forwarding rules.

What to do next

Configure alert contacts

Create event-triggered alert rules

Create threshold-triggered alert rules