In the IoT Platform console, you can add multiple properties, events, and services by importing a TSL. To import a TSL, you can upload a TSL JSON file or copy a TSL of another product to the current product.

Notes

  • The previously defined features of the product is overwritten after you import a new TSL. Proceed with caution.
  • If the connection protocol of a device is Modbus, you cannot import a TSL.
  • If a product has been published, you cannot add or edit TSL features of the product. To add or edit TSL features, you must unpublish the TSL.
  • If you import the TSL of another product, the values of the Category parameter that are specified for two products must be the same.

Import a TSL

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Devices > Products.
  3. In the product list of the Products page, find the required product and click View in the Actions column.
  4. On the Product Details page, choose Define Feature > Edit Draft.
  5. Click Import. In the dialog box that appears, import a TSL.
    Import a TSL

    You can use either of the following methods to import a TSL:

    • Copy Product: Select a product and version, and click OK to import a TSL.

      If you need to modify features after importing the TSL, go to the Define Feature tab. On this tab, click Edit Draft. Find the required feature and click Edit in the Actions column.

    • Import TSL: Upload a TSL JSON file. Click OK.

      For more information about how to write a TSL file, see the TSL formats in the Overview topic.

      Note
      • The size of a TSL file cannot exceed 256 KB.
      • In the TSL file, the productKey parameter value must be the key of the current product.
  6. Publish the TSL.
    1. On the Edit Draft page, click Release Online in the lower-left corner.
    2. In the Release model online dialog box, enter a version number and description, and click OK.
      Parameter Description
      Version Number The version of the TSL. You can manage the TSL based on version numbers.

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

      note The description of the TSL. The description can contain Chinese characters, English letters, digits, and special characters. The description can be up to 100 characters in length.
      Note
      • The TSL takes effect only after you publish it.
      • A TSL can contain the last 10 versions. Other historical versions are overwritten.