Before you connect a device to IoT Platform, you must create a product and a device for it in the IoT Platform console to obtain a device certificate. A device certificate includes a ProductKey, DeviceName, and DeviceSecret.
Prerequisites
An Enterprise Edition instance is required. For more information, see Create an Enterprise Edition instance.
Background information
-
A product is a collection of devices that share the same features. You can manage devices by product, for example, to define a TSL model or customize topics.
-
Each physical device must have a device identity on IoT Platform. You must provision the physical device with the device certificate (ProductKey, DeviceName, and DeviceSecret) issued by IoT Platform. The certificate authenticates the device when it connects to the platform. For more information, see Obtain a device certificate.
This topic describes how to create a product, define a TSL model, add a device, and obtain a device certificate for a home thermostat in IoT Platform.
Procedure
-
In the IoT Platform console, on the Overview tab, click the IoT Test Environment instance.
-
In the left-side navigation pane, choose , then click Create Product.
-
On the Create Product page, configure the parameters, then click OK.
In this example, set Product Name to Home Thermostat. Use the default values for the other parameters. For example, Node Type is Directly Connected Device, Connection Method is Wi-Fi, Data Format is ICA Standard Data Format (Alink JSON), Data Validation Level is Relaxed, and Authentication Method is DeviceSecret.

-
On the Create Product page, click Go to Define Thing Specification Language (TSL) model.
Defining a TSL model for the product abstracts a physical product into a data model that consists of properties, services, and events. This model simplifies device management and data interaction in IoT Platform.
-
On the Define Features tab, click Edit Draft and follow these steps to define the temperature and humidity properties for the Home Thermostat product.
-
Under Default Module, click Add Custom Feature to configure the temperature and humidity properties.
For the temperature property, set Feature Type to Property, Feature Name to Temperature, Identifier to temperature, Data Type to double, Value Range to -20–60, Step to 0.1, Unit to Celsius/°C, and Access Mode to Read/Write. For the humidity property, set Feature Name to Humidity, Identifier to humidity, Data Type to int32, Value Range to 0–100, Step to 1, Unit to Percentage/%, and Access Mode to Read/Write.
-
Click Publish in the lower-left corner of the Edit Draft page under Function Definition. The Publish TSL model? dialog box appears.
-
Select the I have confirmed the differences between the current and online versions checkbox.
-
Click OK to publish the TSL model.
-
-
On the Product Details page, click the Devices tab.
-
On the Devices tab, click Add Device. In the dialog box that appears, enter a device name, such as Device1, then click OK.
After the device is created, the Added dialog box appears. Click Copy Device Certificate.
Alternatively, click View to open the Device Details page. On this page, click View next to DeviceSecret.
A device certificate contains the ProductKey, DeviceName, and DeviceSecret. The device uses this credential to communicate with IoT Platform.
ImportantThe device certificate is required to connect your device to IoT Platform. Copy the certificate information and store it securely.
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.