Device Management

Query device information

  • API intent: query.device.info
  • Description: This interface is used to query the basic information of the device, including device ID, position, offline status, firmware version, time zone, etc.
  • Request parameters
Name Type Is required? Description
dids Array No Device ID, at most 100 device IDs can be queried at a time
positionId String No PositionID, if it is empty, query all devices under the user
pageNum int No Page number, default value 1
pageSize int No The number of items per page, the default value is 50
  • Request Demo
{
  "intent": "query.device.info",
  "data": {
    "dids": [
      "virtual2.07737309957642",
      "virtual2.07639066475218"
    ],
    "positionId": "",
    "pageNum": 1,
    "pageSize": 50
  }
}
  • Response parameters
Name Type Description
data Array Device information list
totalCount int Total number of devices

data description:

Name Type Description
did String Device id
parentDid String Gateway id
positionId String Position id
createTime String Create time
updateTime String Update time
model String Object model
modelType Int 1: Gateway that can be linked to sub-device; 2: Gateway that cannot be linked to sub-device; 3: Sub-device
state Integer Device status 0-offline 1-online
firmwareVersion String Device firmware version
deviceName String Device name
timeZone String Time zone
  • Response demo
{
  "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
  }
}

Query sub-device information based on the Gateway

  • API intent: query.device.subInfo
  • Description: This interface is used to query the sub-device information under the specified gateway, including device ID, position, offline status, firmware version, time zone, etc.
  • Request parameters
Name Type Is required? Description
did String Yes Gateway id
  • Request Demo
{
  "intent": "query.device.subInfo",
  "data": {
    "did": "virtual2.11774113824794"
  }
}
Name Type Description
did String Subdevice id
parentDid String Gateway id
positionId String Position id
createTime String Create time
updateTime String Update time
model String Object model
modelType Int 1: Gateway that can be linked to sub-device; 2: Gateway that cannot be linked to sub-device; 3: Sub-device
state Integer Device status 0-offline 1-online
firmwareVersion String Device firmware version
timeZone String Time zone
  • Response demo:
{
  "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"
    }
  ]
}

Update device information

  • API intent: config.device.name
  • Description: This interface is used to modify the device name.
  • Request parameters
Name Type Is required? Description
did String Yes Device id
name String Yes Device Name
  • Request Demo
{
  "intent": "config.device.name",
  "data": {
    "did": "virtual2.11774113824794",
    "name": "xxxx"
  }
}
  • Response parameters: NA

  • Response demo

{
  "code": 0,
  "message": "Success",
  "requestId": "",
  "result": ""
}

Update device position

  • API intent: config.device.position
  • Description: This interface is used to modify device location information.
  • Request parameters
Name Type Is required? Description
dids Array(String) Yes Device id array
positionId String Yes Position id
  • Request Demo
{
    "intent": "config.device.position",
    "data": {
        "dids": ["virtual2.55212213159523"],
        "positionId":"real2.768799734306242560"
    }
}
  • Response parameters: NA

  • Response demo

{
    "code": 0,
    "message": "Success",
    "msgDetails": null,
    "requestId": "",
    "result": ""
}

Unbind device

  • API intent: write.device.unbind
  • Description: This interface is used to unbind the gateway and sub-devices.
  • Request parameters
Name Type Is required? Description
did String Yes Device id
  • Request Demo
{
  "intent": "write.device.unbind",
  "data": {
    "did": "virtual2.40035874561345"
  }
}
  • Response parameters: NA

  • Response demo

{
  "code": 0,
  "requestId": "",
  "message": "Success",
  "msgDetails": null,
  "result": ""
}
Copyright © 2023 Lumi United Technology Co., Ltd. all right reserved,powered by GitbookFile Modify: 2024-09-27 21:51:47

results matching ""

    No results matching ""