Define a TSL model for a product
A TSL model defines the properties, events, and services for a product. This topic describes how to add a TSL model to an existing product in IoT Platform.
Prerequisites
You have created the Temperature and Humidity Sensor and Electrical Parameter Meter products. For more information, see Create a product and a device.
Procedure
-
Log on to the IoT Platform console. On the Instance Overview tab, click the name of your target instance, for example,
iot-cn-z2q1***. -
In the left-side navigation pane, choose .
-
Define properties for the Temperature and Humidity Sensor product.
-
In the Actions column for the Temperature and Humidity Sensor product, click View. On the Product Details page, click the TSL Features tab, and then click Edit Draft.
-
In the default module, click Add TSL Feature. Configure the parameters as shown in the following table, and then click OK.
This example adds two properties: temperature and humidity.
-
Temperature property: For Feature Type, select the Properties tab. For other parameter values, see the following table.
-
Humidity property: Configure this property in the same way, using the values for Humidity from the table below.
Feature name
Identifier
Type
Range
Step
Unit
Access mode
Temperature
Temperature
float
-50 to 50
0.01
Celsius (°C)
Read/Write
Humidity
Humidity
int32
0 to 100
1
Percent (%)
Read/Write
-
-
In the lower-left corner of the page, click Deploy. In the dialog box that appears, click Add Release Note, enter the Version and Description, select the I have confirmed the differences between the current and online versions checkbox, and then click OK.
Parameter
Description
Version
The version of the current TSL model. You can manage TSL models based on their versions.
The version can contain letters, digits, and periods (.), and must be 1 to 16 characters in length.
Description
A description for the TSL model version. The description can contain Chinese characters, letters, digits, and special characters, and must be 100 characters or less. Each Chinese character counts as one character.
-
-
Follow the same procedure to define properties for the Electrical Parameter Meter product. Use the parameters in the following table.
Feature name
Identifier
Type
Range
Step
Unit
Access mode
Voltage
Ua
float
0 to 999
0.01
Volt (V)
Read/Write
Working Current
WorkingCurrent
float
0 to 999
0.01
Ampere (A)
Read/Write
Load Power
LoadPower
float
0 to 999
0.01
Kilowatt (kW)
Read/Write