Add Device Interface
Obtain temporary credentials(bindKey) before the device is registered
- API intent: query.device.bindKey
- Description: This interface is mainly used for Add Hub, which needs to be combined with SDK to execute.
- Request parameters
Name |
Type |
Is required? |
Description |
positionId |
String |
No |
Position id, empty to take the default position |
connectType |
String |
No |
The default is lumi |
{
"intent": "query.device.bindKey",
"data": {
"positionId": "real2.768799734306242560",
"connectType": "lumi"
}
}
Name |
Type |
Description |
bindKey |
String |
Registration voucher. Valid time: 10 minutes. (16-bit string [0-9a-zA-Z]) |
{
"code": 0,
"message": "Success",
"requestId": "",
"result": {
"bindKey": "lumioJuiDuNm9rpj"
}
}
Device registration status query
- API intent: query.device.bind
- Description: This interface is used in conjunction with "query.device.bindKey" to query the actual status of the gateway device.
- Request parameters
Name |
Type |
Is required? |
Description |
bindKey |
String |
Yes |
Registration voucher. Valid time: 10 minutes. (16-bit string [0-9a-zA-Z]) |
{
"intent": "query.device.bind",
"data": {
"bindKey": "lumiuK68vu9IYBAB"
}
}
Name |
Type |
Description |
code |
Int |
0: success; 1: binding, 2: illegal device |
parentDid |
String |
Gateway id |
firmwareVersion |
String |
Gateway firmware version |
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 |
subInfos |
Array |
Detailed information of sub-devices under the Hub |
state |
int |
Device status 0-offline 1-online |
timeZone |
String |
Time zone |
subInfos description:
Name |
Type |
Description |
did |
String |
Subdevice 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 |
int |
Subdevice status 0-offline 1-online |
firmwareVersion |
String |
Subdevice firmware version |
timeZone |
String |
Time zone |
{
"code": 0,
"message": "Success",
"requestId": "",
"result": {
"code": 0,
"parentDid": "virtual2.13107395143333",
"createTime": 1619489728008,
"subInfos": [
{
"createTime": 1619489743705,
"timeZone": "GMT+09:00",
"model": "lumi.airrtc.tcpecn01",
"updateTime": 1619489743705,
"modelType": 3,
"state": 1,
"did": "virtual2.44788360390062"
}
],
"timeZone": "GMT+09:00",
"model": "lumi.gateway.acn01",
"updateTime": 1619489728008,
"modelType": 1,
"state": 1
}
}
Enable Hub to add subdevice mode
- API intent: write.device.openConnect
- Description: This interface is mainly used to add sub-device, to enable the add sub-device mode of the specified gateway device.
- Request parameters
Name |
Type |
Is required? |
Description |
did |
String |
Yes |
Gateway device id |
{
"intent": "write.device.openConnect",
"data": {
"did": "virtual2.59214901702075"
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"requestId": "",
"result": ""
}
Disable Hub to add subdevice mode
- API intent: write.device.closeConnect
- Description: This interface is used in conjunction with "write.device.openConnect" to close the add sub-device mode of the gateway device.
- Request parameters
Name |
Type |
Is required? |
Description |
did |
String |
Yes |
Gateway device id |
{
"intent": "write.device.closeConnect",
"data": {
"did": "virtual2.59214901702075"
}
}
Response parameters: NA
Response demo
{
"code": 0,
"message": "Success",
"requestId": "",
"result": ""
}
Query the list of gateways that support sub-devices
- API intent: query.device.supportGateway
- Description: Since each gateway supports different types of sub-devices, the list of gateways supported by the specified sub-device can be queried through this interface. Used to add sub-device.
- Request parameters
Name |
Type |
Is required? |
Description |
model |
String |
Yes |
Subdevice model |
{
"intent": "query.device.supportGateway",
"data": {
"model": "lumi.ctrl_ln1.aq1"
}
}
Name |
Type |
Description |
model |
String |
Gateway model |
deviceName |
String |
Gateway name |
{
"code": 0,
"message": "Success",
"msgDetails": null,
"requestId": 5278.138.16239230111747455,
"result": [
{
"model": "lumi.gateway.acn01",
"deviceName": "Hub M1S"
},
{
"model": "lumi.gateway.iragl5",
"deviceName": "Hub M2"
}
]
}
Query the list of gateways that support sub-devices based on location
- API intent: query.position.supportGateway
- Description: Through this interface, you can query the list of gateways supported by the sub-device in the specified location. Used to add sub-device.
- Request parameters
Name |
Type |
Is required? |
Description |
positionId |
String |
No |
Position id, empty to take the default position |
model |
String |
Yes |
Subdevice model |
pageSize |
String |
No |
Number of per page, default is 30 |
pageNum |
String |
No |
Page number, default is 1 |
{
"intent": "query.position.supportGateway",
"data": {
"positionId": "real1.768799734012641280",
"model": "lumi.ctrl_ln1.aq1",
"pageNum": "1",
"pageSize": "3"
}
}
Name |
Type |
Description |
count |
Integer |
Total number |
gateways |
Array(Object) |
The list of gateways that support sub-devices |
gateways description
Name |
Type |
Description |
model |
String |
Gateway model |
state |
String |
0-offline 1-online |
deviceName |
String |
Gateway name |
parentId |
String |
Gateway id |
{
"code": 0,
"message": "Success",
"msgDetails": null,
"requestId": 5278.138.16239211117747455,
"result": {
"gateways": [
{
"model": "lumi.gateway.aqhm01",
"state": 1,
"deviceName": "Hub-1",
"parentId": "virtual2.03022099714910"
},
{
"model": "lumi.acpartner.aq1",
"state": 1,
"deviceName": "Air Conditioning Controller-2",
"parentId": "virtual2.70319255630325"
},
{
"model": "lumi.acpartner.aq1",
"state": 1,
"deviceName": "Air Conditioning Controller-1",
"parentId": "virtual2.53946223162278"
}
],
"count": 3
}
}