# 1 请求参数:
字段名称 | 字段说明 | 类型 | 必须 | 备注 |
---|---|---|---|---|
payload.houseId | 家庭id | String | N | 可选参数,可在获取家庭列表接口获取,默认使用绑定家庭 |
payload.withCmd | 是否需要返回离线控制命令 | String | Y | 传true时,会返回离线控制指令,可配合sdk实现离线控制 |
示例
{
"header": {
"type": "LIST",
"version": 1,
"requestTime": 1506588295432,
"requestId": "304a1c510f9e4683a43be5f2a7cfeb52"
},
"payload": {
"houseId": "12312sd",
"withCmd": true
}
}
# 2 请求返回result说明:
字段名称 | 字段说明 | 类型 | 长度 | 备注 |
---|---|---|---|---|
result.devices | 返回设备数组 | Object | - | 格式如下 |
devices[-].deviceId | 设备id | String | 64 | - |
devices[-].deviceType | 设备类型 | String | 64 | - |
devices[-].deviceName | 设备名称 | String | 64 | - |
devices[-].actions | 设备支持操作,是个数组 | Object[] | - | 数组每个元素是object对象,格式如下 |
actions[-].oper | 操作命令 | String | 32 | - |
actions[-].name | 操作名称 | String | 32 | - |
actions[-].cmds | 离线指令 | Array | - | 只有withCmd为true时返回 |
devices[-].status | 设备当前状态 | Object | - | 格式以状态名称为key,状态值为value组成的object对象,可参考示例 |
示例:
{
"success": true,
"message": "success",
"requestId": "304a1c510f9e4683a43be5f2a7cfeb52",
"responseTime": 1506588295432,
"result": {
"devices": [
{
"deviceId": "xxx_xxx_xxxxxxxxxxx",
"deviceName": "空调",
"actions": [
{
"oper": "power",
"name": "打开",
"cmds": [ ]
}
],
"status": {
"openFlag": 1,
"tempSet": 26
}
},
{
"deviceId": "xxx_xxx_xxxxxxxxxxx",
"deviceName": "灯光",
"actions": [
{
"oper": "power",
"name": "打开",
"cmds": [ ]
}
],
"status": {
"openFlag": 1,
"brightness": 50
}
}
]
},
"statusCode": 200
}