In some IoT scenarios, devices that have limited resources or low specifications cannot use Thing Specification Language (TSL) models in the JSON format to communicate with IoT Platform. To resolve the issue, you can pass through raw data from devices to IoT Platform. IoT Platform converts raw device data to Alink JSON data by using data parsing scripts that you submit. Then, you can perform subsequent operations on the converted data.
Background information
The following figure shows how data flows between devices and enterprise servers.

In this example, a device that collects environmental data is used.
Connect a device to IoT Platform
Write a data parsing script
In the IoT Platform console, you can edit, submit, and debug data parsing scripts.
After you submit the script, you can use the device SDK to debug the script. You can submit data. Then, IoT Platform uses the script to parse the data. To view the parsed data, go to the Device Details page. Choose .

Example of upstream TSL data
{
"schema": "https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json",
"profile":
{
"version": "1.0",
"productKey":
"g4***"
},
"properties": [
{
"identifier":
"lightLux",
"name": "illuminance",
"accessMode":
"rw",
"required": false,
"dataType":
{
"type": "float",
"specs":
{
"min":
"0",
"max": "10000",
"unit":
"Lux",
"unitName": "luminous flux per unit area",
"step":
"0.1"
}
}
},
{
"identifier": "PM25",
"name":
"PM25",
"accessMode":
"rw",
"required": false,
"dataType": {
"type":
"int",
"specs": {
"min":
"0",
"max": "1000",
"unit":
"μg/m³",
"unitName": "micrograms per cubic meter",
"step":
"1"
}
}
},
{
"identifier": "hcho",
"name":
"formaldehyde",
"accessMode": "rw",
"desc":
"HCHOValue",
"required": false,
"dataType": {
"type":
"float",
"specs": {
"min":
"0",
"max":
"10",
"unit":
"ppm",
"unitName":
"parts per million",
"step":
"0.1"
}
}
},
{
"identifier": "co2",
"name":
"carbon dioxide",
"accessMode": "rw",
"required": false,
"dataType":
{
"type": "int",
"specs":
{
"min":
"0",
"max": "10000",
"unit":
"mg/m³",
"unitName": "micrograms per cubic meter",
"step":
"1"
}
}
},
{
"identifier": "humidity",
"name":
"humidity",
"accessMode": "rw",
"required": false,
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"100",
"unit": "%",
"unitName":
"percentage",
"step": "1"
}
}
},
{
"identifier":
"temperature",
"name":
"temperature",
"accessMode":
"rw",
"desc":
"motor working temperature",
"required": false,
"dataType":
{
"type": "float",
"specs":
{
"min": "-10",
"max":
"50",
"unit": "℃",
"step":
"0.1"
}
}
}
],
"events": [
{
"identifier":
"post",
"name":
"post",
"type": "info",
"required": true,
"desc":
"submit properties",
"method": "thing.event.property.post",
"outputData":
[
{
"identifier": "lightLux",
"name":
"illuminance",
"dataType": {
"type":
"float",
"specs": {
"min":
"0",
"max": "10000",
"unit":
"Lux",
"unitName": "luminous flux per unit area",
"step":
"0.1"
}
}
},
{
"identifier": "PM25",
"name":
"PM25",
"dataType":
{
"type":
"int",
"specs":
{
"min":
"0",
"max": "1000",
"unit":
"μg/m³",
"unitName": "micrograms per cubic meter",
"step":
"1"
}
}
},
{
"identifier": "hcho",
"name":
"formaldehyde",
"dataType":
{
"type": "float",
"specs":
{
"min": "0",
"max":
"10",
"unit": "ppm",
"unitName":
"parts per million",
"step": "0.1"
}
}
},
{
"identifier":
"co2",
"name": "carbon dioxide",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"10000",
"unit": "mg/m³",
"unitName":
"micrograms per cubic meter",
"step":
"1"
}
}
},
{
"identifier":
"humidity",
"name":
"humidity",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"100",
"unit": "%",
"unitName":
"percentage",
"step":
"1"
}
}
},
{
"identifier": "temperature",
"name":
"temperature",
"dataType": {
"type":
"float",
"specs": {
"min":
"-10",
"max": "50",
"unit":
"℃",
"step": "0.1"
}
}
}
]
}
],
"services":
[
{
"identifier": "set",
"name":
"set",
"required": true,
"callType": "async",
"desc":
"set properties",
"method": "thing.service.property.set",
"inputData":
[
{
"identifier":
"lightLux",
"name":
"illuminance",
"dataType":
{
"type":
"float",
"specs": {
"min":
"0",
"max": "10000",
"unit":
"Lux",
"unitName": "luminous flux per unit area",
"step":
"0.1"
}
}
},
{
"identifier": "PM25",
"name":
"PM25",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"1000",
"unit": "μg/m³",
"unitName":
"micrograms per cubic meter",
"step": "1"
}
}
},
{
"identifier":
"hcho",
"name": "formaldehyde",
"dataType":
{
"type": "float",
"specs":
{
"min": "0",
"max":
"10",
"unit":
"ppm",
"unitName":
"parts per million",
"step":
"0.1"
}
}
},
{
"identifier":
"co2",
"name": "carbon dioxide",
"dataType":
{
"type":
"int",
"specs": {
"min":
"0",
"max": "10000",
"unit":
"mg/m³",
"unitName": "micrograms per cubic meter",
"step":
"1"
}
}
},
{
"identifier":
"humidity",
"name": "humidity",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"100",
"unit":
"%",
"unitName": "percentage",
"step":
"1"
}
}
},
{
"identifier": "temperature",
"name":
"humidity",
"dataType": {
"type":
"float",
"specs": {
"min":
"-10",
"max": "50",
"unit":
"℃",
"step": "0.1"
}
}
}
],
"outputData":
[]
},
{
"identifier": "get",
"name":
"get",
"required": true,
"callType": "async",
"desc":
"obtain properties",
"method": "thing.service.property.get",
"inputData":
[
"lightLux",
"PM25",
"hcho",
"co2",
"humidity",
"temperature"
],
"outputData": [
{
"identifier":
"lightLux",
"name":
"illuminance",
"dataType":
{
"type":
"float",
"specs":
{
"min": "0",
"max":
"10000",
"unit": "Lux",
"unitName":
"luminous flux per unit area",
"step": "0.1"
}
}
},
{
"identifier":
"PM25",
"name": "PM25",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"1000",
"unit": "μg/m³",
"unitName":
"micrograms per cubic meter",
"step": "1"
}
}
},
{
"identifier":
"hcho",
"name": "formaldehyde",
"dataType":
{
"type": "float",
"specs":
{
"min":
"0",
"max":
"10",
"unit":
"ppm",
"unitName":
"parts per million",
"step": "0.1"
}
}
},
{
"identifier":
"co2",
"name": "carbon dioxide",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"10000",
"unit": "mg/m³",
"unitName":
"micrograms per cubic meter",
"step": "1"
}
}
},
{
"identifier":
"humidity",
"name": "humidity",
"dataType":
{
"type": "int",
"specs":
{
"min": "0",
"max":
"100",
"unit": "%",
"unitName":
"percentage",
"step":
"1"
}
}
},
{
"identifier":
"temperature",
"name":
"temperature",
"dataType":
{
"type": "float",
"specs":
{
"min": "-10",
"max":
"50",
"unit": "℃",
"step":
"0.1"
}
}
}
]
}
]
}