2.Device Lifecycle Event message
The rule engine has defined different fixed basic message formats for different message sources as the SQL processing basis of the rule.
Device data point message is formatted as follows:
Parameter | Property | Type | Description | Example |
---|---|---|---|---|
sysProperty | messageType | string | Message type: fixed as deviceDatapo | |
productId | string | Product ID | 90273 | |
appProperty | deviceId | string | Device ID | 102839 |
dataTimestamp | int | production time stamp at the device data point, expressed in ms | 15980987429000 | |
datastream | string | Data flow name, objected_instance_resource in NBIoT | 3303_0_5700 | |
body | object/string/... | Detailed data point | See the example below |
Json Example 1: Json Data
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"weather"
},
"body":{
"temperature": 30,
"humidity": "47%"
}
}
Json Example 2: Numeric Data
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"temperature"
},
"body": 10
}
Json Example 3: String
{
"sysProperty": {
"messageType": "deviceDatapoint",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
"datastream":"weather"
},
"body":"sunny with wind"
}
The device lifecycle event message format is as follows:
Parameter | Property | Type | Description | 示例 |
---|---|---|---|---|
sysProperty | messageType | string | Message type: fixed as deviceLifeCycle | |
productId | string | Product ID | 90273 | |
appProperty | deviceId | string | Device ID | 102839 |
dataTimestamp | int | Device message production time stamp, millisecond | 15980987429000 | |
body | object | Created, deleted, online, offline created/deleted/online/offline |
Json Example
{
"sysProperty": {
"messageType": "deviceLifeCycle",
"productId": "90273",
},
"appProperty":{
"deviceId": "102839",
"dataTimestamp": 15980987429000,
},
"body":{
"event": "online"
}
}