命令下发会指定某台MQTT设备,并对此设备的指定属性进行异步读写。
功能描述:MQTT设备异步下发命令读取/写入功能点属性信息
POST /api/v1/commands-async/mqtt
Body:
Name | Type | Description | Required |
---|---|---|---|
deviceId | int | 设备ID | Yes |
functionType | string | 命令类型,可选值propertyGet/propertySet | Yes |
identifier | string | 属性名 | Yes |
identifierValue | object | 属性值,functionType值为propertySet时必需 | No |
Body example:
{
"deviceId":10086,
"functionType": "propertySet",
"identifier": "身高",
"identifierValue": "180"
}
当功能属性类型为Bytes时,identifierValue由多个16进制字符和空格组成,空格无实际意义,例如:
"identifierValue": "13 0F 03"
cURL example:
curl --location --request POST '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/commands-async/mqtt?accessKeyId={accessKeyId}&signatureNonce=495&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}' \
--header 'Content-Type: application/json' \
--data-raw '{
"deviceId":10086,
"functionType": "propertySet",
"identifier": "身高",
"identifierValue": "180"
}'
Response data:
Name | Type | Description |
---|---|---|
commandId | String | 命令ID |
Response
{
"code":0,
"message":"",
"data":{
"commandId": "02e86b96-a484-4e4e-9282-84b804f68fd5"
}
}
功能描述:MQTT设备异步下发命令读取/写入功能点属性信息
POST /api/v1/device/command/byname/async
Body:
Name | Type | Description | Required |
---|---|---|---|
productId | int | 产品ID | Yes |
deviceName | string | 设备名称 | Yes |
functionType | string | 命令类型,可选值propertyGet/propertySet | Yes |
identifier | string | 属性名 | Yes |
identifierValue | object | 属性值,functionType值为propertySet时必需 | No |
Body example:
{
"productId":10086,
"deviceName": "test",
"functionType": "propertySet",
"identifier": "身高",
"identifierValue": "180"
}
当功能属性类型为Bytes时,identifierValue由多个16进制字符和空格组成,空格无实际意义,例如:
"identifierValue": "13 0F 03"
cURL example:
curl --location --request POST '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/device/command/byname/async?accessKeyId={accessKeyId}&signatureNonce=495&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}' \
--header 'Content-Type: application/json' \
--data-raw '{
"productId":10086,
"deviceName": "test",
"functionType": "propertySet",
"identifier": "身高",
"identifierValue": "180"
}'
Response data:
Name | Type | Description |
---|---|---|
commandId | String | 命令ID |
Response
{
"code":0,
"message":"",
"data":{
"commandId": "02e86b96-a484-4e4e-9282-84b804f68fd5"
}
}