If needs to integrate the Aqara device into a third-party APP, the developer can choose to integrate the SDK.

There are currently two types of SDK: SDK without UI, which provides demo, all front-end pages need to be designed and developed by the developer; SDK with UI, provides SDK and demo with Aqara style, developers can also replace with their own brand UI interaction style.

The APP SDK is generally suitable for virtual account authorization. For the authorization process, please refer to "Authorization management-Obtain virtual account authorization through API" page.

SDK without UI

The SDK is only used for add gateway device, and add the sub-device through the write.device.openConnect interface.

The process is as follows:

SDK process

Note: Since IOS is mandatory for Homekit, the device with Homekit function needs to be equipped with Homekit process when adding it using IOS mobile phone.

SDK with UI

The SDK with UI will provide a standardized UI interactive page in Aqara style. Developers can use it directly or change the interactive UI design according to their own APP style.

SDK integration instructions

Integration process is as follows:


Currently we haven't provided download link for this SDK. If you have any requirements, please consult Lumi Oversea Business. Thanks.

Get UI-SDK initialization parameter interface

  • Request parameters: NA

  • Request demo

    "intent": "", 
    "data": {
  • Response parameters
Name Type Description
userId String Aqara user unique id
token String APP sdk access token for lumi service
appRequestDomain String Service domain address requested by APP-SDK
expiresIn Int Token expiration time, in seconds
positionId String Default position
baseH5Url String H5 URL of SDK
baseImageUrl String Image CDN address of SDK
appId String SDK initialization parameter
appKey String SDK initialization parameter
  • Response demo
"code": 0,
    "requestId": "",
    "message": "Success",
    "msgDetails": null,
    "result": {

Notify token expiration interface

  • Request parameters
Name Type Is required? Description
token String Yes APP sdk access token for lumi service
  • Request demo
    "intent": "", 
    "data": {
        "token": "xxx"
  • Response parameters: NA

  • Response demo

"code": 0,
    "requestId": "",
    "message": "Success",
    "msgDetails": null

Message Push

The message push process is as follows:


Request Description

Request URL: The message receiving address configured on the message push page. (Login to Aqara Developer Platform-Console, Application Management-Message push settings page), example:

Request Method: HTTP POST (application/json)

Request header parameters:

Name Type Is required? Description
time String Yes Request time
nonce String Yes Request a random number to guarantee the uniqueness of the request
appkey String No Request the signature key
If the configuration is turned on, it will be returned.
sign String No Request signature
If the configuration is turned on, it will be returned.

Signature rules:

  1. The parameters(appkey, nonce, time) requested by the head are first sorted according to the ASCII code, and then spliced.

    Splice method: appkey=xxx&nonce=xxx&time=xxx

  2. Splice appSecret with the string generated in the second step.

    Example: appkey=xxx&nonce=xxx&time=xxx&appSecret

  3. Do lowercase processing for the string generated in the second step.

  4. MD5 32-bit for the character generated in the third step, and the generated number is the value of Sign.

Note: Sign is not enabled by default. If you need to enable signature, you need to configure appKey (signature Key) and appSecret (signature secret key) on Aqara Developer Platform -Console, Application Management-Message push settings page.

------------------------------------Step 1: splicing header parameters ---------------------
------------------------------------Step 2: Splicing appSecret parameters ------------------
------------------------------------Step 3: Lowercase the string ---------------------------
------------------------------------Step 4: MD5 32-bit encryption --------------------------

Request Body parameters

Name Type Is required? Description
token String Yes Terminal push id
Corresponding to push the clientId generated by the third party to the app-sdk, separated by English commas when there are multiple.
data String Yes Specific data pushed to app-sdk

Request Demo


Response Format


Note: When the third-party system receives the pushed HTTP message, please return it according to the above example. If the return format does not meet the requirements, the Aqara system will consider the third-party receiving message system service abnormal, and will stop performing the third-party system under certain conditions.

Copyright © 2023 Lumi United Technology Co., Ltd. all right reserved,powered by GitbookFile Modify: 2024-04-24 15:18:24

results matching ""

    No results matching ""