All Products
Search
Document Center

IoT Platform:Create a product and a device

Last Updated:Oct 31, 2023

To connect a device to IoT Platform, you must create a product, add a device to the product, and then obtain the device certificate in the IoT Platform console. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.

Prerequisites

An Enterprise Edition instance is purchased. For more information, see Purchase an Enterprise Edition instance.

Background information

  • A product is a collection of devices with the same features. You can manage the devices of a product in batches. For more information, see Define TSL models and Custom topics.

  • Each physical device must correspond to an IoT Platform device. You must burn a device certificate (ProductKey, DeviceName, and DeviceSecret) that is issued by IoT Platform to a device. When you connect the device to IoT Platform, you can then use the certificate to authenticate the device. For more information, see Obtain device certificates.

This topic describes how to create a product, define a Thing Specification Language (TSL) model, add a device, and obtain a device certificate for a home thermostat in the IoT Platform console.

Procedure

  1. On the Overview tab in the IoT Platform console, click IoT_Test_Environment.

  2. In the left-side navigation pane, choose Devices > Products. On the page that appears, click Create Product.

  3. On the Create Product page, configure the parameters and click OK.

    In this example, the Product Name parameter is set to Home_Thermostat and the default values are used for other parameters, as shown in the following figure.新建产品(国际)

  4. On the page that appears after the product is created, click Create TSL.

    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 facilitates cloud management and data interaction.

  5. On the Define Feature tab, click Edit Draft. Perform the following steps to define the temperature and humidity properties for the home thermostat:

    1. In the Default Module section, click Add Self-defined Feature and then define the temperature and humidity properties.

      定义物模型
    2. 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.

    3. 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.

  6. On the Product Details page, click Manage.

    管理设备
  7. On the Devices tab, click Add Device. In the dialog box that appears, enter a DeviceName such as Device1 and click OK.

    添加设备

    In the The devices have been added. dialog box, click Copy Device Certificate to obtain the device certificate.

    You can also click Learn More. On the Device Details page, click View next to DeviceSecret to obtain the device certificate.

    A device certificate consists of a ProductKey, a DeviceName, and a DeviceSecret. A device certificate is the credential that a device uses to communicate with IoT Platform.

    Important

    We recommend that you copy the information of your device certificate and keep the information in a secure location. The device certificate is required when you connect the device to IoT Platform.

    Parameter

    Description

    ProductKey

    The ProductKey of the product to which the device belongs. The ProductKey is the GUID that is issued by IoT Platform to the product.

    DeviceName

    The DeviceName of the device, which is the unique identifier of the device within the product. A combination of the DeviceName and ProductKey is used as the device identifier. IoT Platform authenticates the device and communicates with the device based on the device identifier.

    DeviceSecret

    The DeviceSecret of the device, which is issued by IoT Platform for device authentication and encryption. The DeviceSecret must be used in combination with the DeviceName.

What to do next

Connect the device to IoT Platform and submit data