设备管理接口

查询设备信息

  • 接口intent:query.device.info
  • 接口描述:本接口用于查询设备的基本信息,包含设备ID、位置信息、在离线状态、固件版本、时区等。
  • 请求参数
名称 类型 是否必须 描述
dids Array(String) 设备id,最多一次查询100个设备id
positionId String 位置ID,若为空则查询该用户下的所有设备
pageNum int 页码,默认值1
pageSize int 每页item个数,默认值50
  • 请求示例
{
    "intent": "query.device.info",
    "data": {
        "dids": [
            "virtual2.07737309957642",
            "virtual2.07639066475218"
        ],
        "positionId": "",
        "pageNum": 1,
        "pageSize": 50
    }
}
  • 返回参数
名称 类型 描述
data Array 设备信息列表
totalCount int 查询设备数

data说明:

名称 类型 描述
did String 设备id
parentDid String 网关id
positionId String 位置id
createTime String 入网时间
updateTime String 更新时间
model String 物模型
modelType Int 1:可挂子设备的网关;2:不可挂子设备的网关;3:子设备
state Integer 在线状态:0-离线 1-在线
firmwareVersion String 固件版本号
deviceName String 设备名称
timeZone String 时区
  • 返回示例
{
  "code": 0,
  "message": "Success",
  "requestId": "",
  "result": {
    "data": [
      {
        "parentDid": "",
        "positionId": "real2.730432352746111072",
        "createTime": 1615899097028,
        "timeZone": "GMT+09:00",
        "model": "lumi.gateway.aqhm01",
        "updateTime": 1615899097028,
        "modelType": 1,
        "state": 1,
        "firmwareVersion": "3.2.6",
        "deviceName": "Aqara Hub",
        "did": "lumi.07737309957642"
      },
      {
        "parentDid": "",
        "positionId": "real2.730432352746111072",
        "createTime": 1615901365498,
        "timeZone": "GMT+09:00",
        "model": "lumi.acpartner.v3",
        "updateTime": 1615901365498,
        "modelType": 1,
        "state": 1,
        "firmwareVersion": "3.2.6",
        "deviceName": "Hub",
        "did": "lumi.07639066475218"
      }
    ],
    "totalCount": 2
  }
}

查看网关下子设备信息

  • 接口intent:query.device.subInfo
  • 接口描述:本接口用于查询指定网关下的子设备信息,包含设备ID、位置信息、在离线状态、固件版本、时区等。
  • 请求参数
名称 类型 是否必须 描述
did String 网关设备id
  • 请求示例
{
    "intent": "query.device.subInfo",
    "data": {
        "did": "virtual2.11774113824794"
    }
}
名称 类型 描述
did String 子设备id
parentDid String 网关id
positionId String 位置id
createTime String 入网时间
updateTime String 更新时间
model String 物模型
modelType Int 1:可挂子设备的网关;2:不可挂子设备的网关;3:子设备
state Integer 在线状态:0-离线 1-离线
firmwareVersion String 固件版本号
timeZone String 时区
  • 返回示例:
{
    "code": 0,
    "message": "Success",
    "requestId": "",
    "result": [
        {
            "parentDid": "virtual2.11774113824794",
            "positionId": "real2.730432352746111072",
            "createTime": 1617871502389,
            "timeZone": "GMT+09:00",
            "model": "lumi.ctrl_ln1.v1",
            "updateTime": 1617871502389,
            "modelType": 3,
            "state": 1,
            "did": "virtual2.64483555231364"
        }
    ]
}

更新设备信息

  • 接口intent:config.device.name
  • 接口描述:本接口用于修改设备名称。
  • 请求参数
名称 类型 是否必须 描述
did String 设备id
name String 设备名称
  • 请求示例
{
    "intent": "config.device.name",
    "data": {
        "did": "virtual2.11774113824794",
        "name": "xxxx"
    }
}
  • 返回参数:无
  • 返回示例
{
    "code": 0,
    "message": "Success",
    "requestId": "",
    "result": ""
}

修改设备位置

  • 接口intent:config.device.position
  • 接口描述:本接口用于修改设备位置信息。
  • 请求参数
名称 类型 是否必须 描述
dids Array(String) 设备id数组
positionId String 位置id
  • 请求示例
{
    "intent": "config.device.position",
    "data": {
        "dids": ["virtual2.55212213159523"],
        "positionId":"real2.768799734306242560"
    }
}
  • 返回参数:无
  • 返回示例
{
    "code": 0,
    "message": "Success",
    "msgDetails": null,
    "requestId": "",
    "result": ""
}

解绑设备

  • 接口intent:write.device.unbind
  • 接口描述:本接口用于解绑网关和子设备。
  • 请求参数
名称 类型 是否必须 描述
did String 网关设备id或子设备id
  • 请求示例
{
    "intent": "write.device.unbind",
    "data": {
        "did": "virtual2.40035874561345"
    }
}
  • 返回参数:无
  • 返回示例
{
    "code": 0,
    "requestId": "",
    "message": "Success",
    "msgDetails": null,
    "result": ""
}
Copyright © 2023 深圳绿米联创科技有限公司 all right reserved,powered by Gitbook文档修改时间: 2024-02-21 09:55:50

results matching ""

    No results matching ""