IoT Platform allows you to define a Thing Specification Language (TSL) model for a product. You can abstract product features into a data model that consists of properties, services, and events. This way, IoT Platform can manage the devices of products and exchange data with the devices in an efficient manner. After a product is created, you can define a TSL model for the product. The devices of the product automatically inherit the features from the TSL model.

Prerequisites

A product is created. For more information, see Create a product and add a device.

Background information

This article describes how to define the Current and Main Light Switch TSL properties for the product to which a street lamp belongs. After you define the TSL model, you can add street lamps to the product. The street lamps automatically inherit the defined TSL model. For more information about TSL models, see What is a TSL model?.

Procedure

  1. Log on to the IoT Platform console.
  2. On the Overview page, click the Public Instance card.
    Important If IoT Platform is activated in the China (Shanghai) or Japan (Tokyo) region, perform this step. If IoT Platform is activated in other regions, skip this step.
  3. In the left-side navigation pane, choose Devices > Products. In the product list, find the product and click View in the Actions column.
  4. On the Product Details page, click the Define Feature tab, and then click Edit Draft.Power Bank Cabinet-Define Feature-Edit Draft
  5. In the Default Module section of the Define Feature page, click Add Self-defined Feature to configure the TSL feature and then click OK.
    Configure the Main Light Switch and Current properties, as shown in the following figures.
    • Main Light Switch propertyiot
    • Current propertyProperty_Counter
  6. Optional. Click TSL Model. On the Full TSL tab, you can view the JSON file of the complete TSL model.
    iot
  7. Release the TSL model.
    Important A TSL model takes effect only after the model is published
    1. Choose Define Feature > Edit Draft. In the lower-left corner of the page that appears, click Release online. The Release model online? dialog box appears.
    2. Click +Add post notes, and configure the Version Number and note parameters. The following table describes the parameters.
      ParameterDescription
      Version NumberThe version number of the TSL model. You can manage the TSL model based on the version number.

      The version number must be 1 to 16 characters in length, and can contain letters, digits, and periods (.).

      noteThe description of the TSL model. The description can contain letters, digits, and special characters. The description must be 1 to 100 characters in length.
    3. If an online version is available, you must check the differences between the version that you want to release and the online version.
      Click View Differences. In the View Differences panel, you can view the differences between the versions. After you confirm the settings, click Confirm. In the Release model online? dialog box, the checkbox is automatically selected.

      If you do not want to view the differences between the versions, select "Make sure that you have verified the differences between the current version and the online version."

    4. Click OK to publish the TSL model.

What to do next

Connect a device to IoT Platform