[go: up one dir, main page]

0% found this document useful (0 votes)
25 views221 pages

LifeSmart Cloud Platform API

The LifeSmart Cloud Platform (v1.38) document outlines the version history and updates made to the platform, detailing various interface descriptions and functionalities for managing smart devices. It provides guidelines for third-party applications to register, obtain user authorization, and utilize the OpenAPI for device control and management. The document also includes specifications for WebSocket events, security policies, and error codes, ensuring secure and efficient integration with the platform.

Uploaded by

aboodmord6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views221 pages

LifeSmart Cloud Platform API

The LifeSmart Cloud Platform (v1.38) document outlines the version history and updates made to the platform, detailing various interface descriptions and functionalities for managing smart devices. It provides guidelines for third-party applications to register, obtain user authorization, and utilize the OpenAPI for device control and management. The document also includes specifications for WebSocket events, security policies, and error codes, ensuring secure and efficient integration with the platform.

Uploaded by

aboodmord6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 221

LifeSmart Cloud Platform (v1.

38)

Version Revise Date Revisor Revise Contents

1.11 2018/04/20 Jon Fan Add a detailed description of WebSocket events;

1.12 2018/09/20 Jon Fan Add EpAdd extended parameter description;

Add EpSet extended parameter description;

Fix the unreasonable part of the document

Description;

1.13 2018/10/08 Jon Fan Add EpUpgradeAgt,EpRebootAgt,

EpGetAgtLatestVersion document description;

Add lHeart and lDbm descriptions for device

attributes;

Add device model description;

EpSet adds instructions for modifying the name of

Ep/IO;

1.14 2018/11/25 Jon Fan Add EpSearchSmart, EpAddSmart interface

1.15 2018/12/05 Jon Fan Add EpCmd, EpGetAgtState interface description,

and modify EpGetAll interface Description, add

agt_self and description of smart device;

1.16 2018/12/12 Jon Fan WebSocket adds AI event notification description;


1.17 2019/01/24 Jon Fan Add description of ext_loc attribute of device/AI;

1.18 2019/02/14 Jon Fan Add EpGetAttrs interface;

1.19 2019/03/01 Jon Fan Add EpSet interface to modify the description of

the name of the Smart Station;

Add EpTestRssi interface;

1.20 2019/06/03 Jon Fan Added the description of the v value in the device

IO attribute returned by the EpGet/EpGetAll

interface;

Add the description of the svrrgnid attribute

returned by authorization;

Add EpBatchSet interface;

1.21 2019/10/18 Jon Fan Add EpSearchIDev, EpAddIDev interface

description;

1.22 2019/12/30 Jon Fan Add EpMaintOtaFiles, EpMaintOtaTasks interface

description;

1.23 2020/01/07 Jon Fan Add EpMaintAgtRM interface description;

1.24 2020/03/11 Jon Fan Add EpSetVar interface description;

EpUpgradeAgt interface adds HTTP upgrade

method description;

1.25 2020/04/08 Jon Fan Add EpConfigAgt interface description;


1.26 2020/04/21 Jon Fan Add fullClsDescription to the Device Model;

1.27 2020/07/01 Jon Fan EpConfigAgt interface adds timezone setting;

EpCmd interface adds cloudview outdoor camera

sound and light alarm settings;

1.28 2021/06/10 Pretty Ju Update Appendix 1;

1.29 2021/07/14 Jon Fan Improve Device Model;

1.30 2022/02/08 Jon Fan EpConfigAgt interface add NIF configuration

1.31 2022/03/02 Jon Fan EpConfigAgt Interface documentation reorganized

and add ocal interconnect interface description

1.32 2022/06/23 Pretty Ju Delete Headers["X-LS-SVRRGNID"];Update

Appendix1 and Appendix2;细节描述优化;

1.33 2022/07/27 Jon Fan EpConfigAgt interface add resetRfModule

description

1.34 2022/08/02 Pretty Ju Add NatureCtl interface description

1.35 2022/10/22 Jon Fan EpMaintOtaFiles, EpMaintOtaTasks interfaces add

extended command descriptions

1.36 2023/2/8 Jon Fan WebSocket event added elog description

1.37 2023/6/26 Jon Fan Added operExSv configuration to the EpConfigAgt

interface
1.38 2023/08/22 Jon Fan Add

EpMaintCartFiles
Cattalog
LifeSmart Cloud Platform (v1.38) .................................................................................................................................1
1. Introduction ................................................................................................................................................................... 7
1.1 Interface Use Process ...................................................................................................................................... 7
2. Register Application ................................................................................................................................................... 9
3. Application Obtain Users Authorization .................................................................................................................9
3.1. Request URL ..................................................................................................................................................... 9
3.2. Request Parameter .......................................................................................................................................10
3.3. Authorization Process ..................................................................................................................................11
3.4. Refresh Usertoken ........................................................................................................................................ 14
4. OpenAPI .......................................................................................................................................................................18
4.1. HTTPS Request Specification .................................................................................................................... 18
4.1.1. URL ........................................................................................................................................................ 18
4.1.2. Request Body JSON Format ...........................................................................................................18
4.1.4. Response JSON Format ...................................................................................................................22
4.2. Security Policy ............................................................................................................................................... 22
4.2.1. Signature Algorithm .......................................................................................................................... 23
4.2.2. Signature Sample ..............................................................................................................................24
4.3. Error Code ...................................................................................................................................................... 26
4.4. Device Model ..................................................................................................................................................27
4.5. OpenAPI Interface Specifications ............................................................................................................. 33
4.5.1. EpAddAgt (Add Smart Station) ...................................................................................................... 33
4.5.2. EpDeleteAgt (Delete Smart Station) ............................................................................................ 36
4.5.3. EpGetAllAgts (Get All Smart Station) .......................................................................................... 39
4.5.4. EpAdd (Add Sub Device) .................................................................................................................42
4.5.5. EpRemove (Delete Device) ............................................................................................................. 49
4.5.6. EpGetAll (Get All Device Information) ..........................................................................................52
4.5.7. EpGet (Get a Device Information) .................................................................................................57
4.5.8. EpSet (Control Smart Device) ........................................................................................................60
4.5.9. EpsSet (Control Multiple Devices) ................................................................................................65
4.5.10. SceneGet (Get Scene ) .................................................................................................................. 69
4.5.11. SceneSet (Trigger Scene) .............................................................................................................. 72
4.5.12. EpUpgradeAgt (Upgrade Smart Station) ...................................................................................77
4.5.13. EpRebootAgt (Reboot Smart Station) ........................................................................................82
4.5.14. EpGetAgtLatestVersion (Get the latest Version of Smart Station) .....................................85
4.5.15. EpSearchSmart (Search for nearby Smart Devices) .............................................................. 89
4.5.16. EpAddSmart (Add the searched Smart Devices) .....................................................................93
4.5.17. EpGetAgtState (Get the Smart Station status) ........................................................................97
4.5.18. EpCmd (Set Devices by Advanced Command) ...................................................................... 100
4.5.19. EpSetVar (Set Devices by Low-Level Command) ................................................................ 107
4.5.20. EpGetAttrs (Get Device extended attributes) ........................................................................111
4.5.21. EpTestRssi (Test RF Device Communication Quality) ......................................................... 115
4.5.22. EpBatchSet (Set Multiple Device in Batch) ............................................................................120
4.5.23. EpSearchIDev (Search for nearby IP network Device) ........................................................ 130
4.5.24. EpAddIDev (Add the nearby IP network Device) ...................................................................135
4.5.25. EpMaintOtaFiles (Maintain the OTA FileList) ........................................................................ 142
4.5.26. EpMaintOtaTasks (Maintain The OTA Task) ......................................................................... 149
4.5.27. EpMaintAgtRM (Backup or Restore The Smart Station) .................................................... 155
4.5.28. EpMaintCartFiles(View or maintain the list of Cart files on the smart station) ............163
4.5.29. EpConfigAgt (Set Smart Station Configuration) ...................................................................167
5. Device Attributes Specifications ......................................................................................................................... 184
6. Discovery Protocol .................................................................................................................................................. 185
7. WebSocket Event .................................................................................................................................................... 186
7.1. Flow ................................................................................................................................................................. 187
7.2. URL ................................................................................................................................................................. 187
7.3. WebSocket Authorization ..........................................................................................................................188
7.3.1. Request Specification .....................................................................................................................188
7.3.2. Example .............................................................................................................................................189
7.4. WebSocket Remove Authentication ....................................................................................................... 191
7.4.1. Request Specification .....................................................................................................................191
7.4.2. Example .............................................................................................................................................192
7.5. Event Format ................................................................................................................................................ 193
7.6. Event Specification .....................................................................................................................................193
8. LifeSmart Account API ...........................................................................................................................................210
8.1. Register Account ......................................................................................................................................... 210
8.1.1. Request Specification ..................................................................................................................... 210
8.1.2. Example ............................................................................................................................................. 212
8.2. Deauthorize Account ..................................................................................................................................214
8.2.1. Request Specification .................................................................................................................... 214
8.2.2. Example .............................................................................................................................................215
Appendix 1 Country abbreviations and svrrgnid ................................................................................................... 217
Appendix 2 Svrrgnid and Server URL ......................................................................................................................221
1.Introduction

The LifeSmart Cloud Platform (hereinafter referred to as the Platform) provides external

services such as adding, searching, status query and control of smart devices. Third-party

applications connect to the Platform through HTTPS connections to complete the operation

and management of smart devices. At the same time, for connection security, all requests

must follow the signature rules of the Platform.

1.1 Interface Use Process

Before third-party applications (hereinafter referred to as the Application) use Platform

services, they need to register smart applications with LifeSmart to obtain a unique appkey

and apptoken, and then third-party applications must be authorized by the user to obtain

access control permissions for the device to provide services. If the user has not registered a

LifeSmart account, he can register the user through the RegisterUser interface of the cloud

platform and complete the automatic authorization, and obtain the userid and usertoken as
well as expiredtime.
2.Register Application

The Application needs to use the services of the Platform. It must first register on the

LifeSmart Open Platform to obtain the appkey and apptoken. After the registration is

successful, the following information will be obtained.

Name Description

appkey Application key, each application must apply for a unique key of its

own

apptoken Application token, please keep the token properly and don’t leak it

Note:

For registration, please contact LifeSmart or apply for third-party applications through the LifeSmart

Open Platform.

3.Application Obtain Users Authorization

3.1.Request URL

https://api.us.ilifesmart.com/app/auth.authorize?id=***&appkey=***&time=***&auth_callb
ack=***&did=***&sign=***&lang=zh
3.2.Request Parameter

Name Type Description

id int Message id, will be return when call successfully.

appkey string appkey obtained when applying for a smart application

time int UTC timestamp, since January 1st, 1970, in seconds.

auth_callback string URL to be called back after successful authorization.

sign string Signature value, signature algorithm see Note.

did string (Optional) The unique id of the terminal device, which can

be used to distinguish multiple terminals.

lang string Display language type, currently supports zh, en, jp, the

default is zh

Note:

• time: Timestamp. If the requested time differs from the Platform time by more than 5 minutes, the

request is invalid.

• did: The terminal device id, used to identify the currently used device. If you need to support multi-

terminal access, you need to pass this parameter, otherwise you don't need to pass this parameter.

【If the <did> value is included in the authorization, when use the usertoken obtained after

authorization, the param <sysyem.did> must keep the same as the <did> used when authorize.】

• sign: signature algorithm:

a) Signature original string:


appkey=***&auth_callback=***&did=***&time=***&apptoken=***(Signature original string

(except apptoken) is generated in alphabetical order. If there is did, then input it into the

signature, otherwise ignore it.)

b) Encrypt the initial signature string using MD5, and transform it to 32 bits 16-lowercase-string

as the signature value sign.

c) Note: lang does not put the original string in the signature, that is, no signature is required.

d) The MD5 algorithm must be correct and can be compared with the following string:

Signature original string as:

appkey=1111111111&auth_callback=http://localhost:8080/CallBack.ashx&time=1445307713&
apptoken=ABCDEFGHIKJLMJOBPOOFPDFDA

Sign value as:

0972888fac34d1d151e4433c9dc7a102

The request URL service address api.ilifesmart.com is not the only one. If it is clearly an application in

other regions, you can directly use the URL address in that region. For example, an application in the

European region can directly use the api.eur.ilifesmart.com service address. Currently, you can still

use the api.ilifesmart.com service address to complete application authorization, but subsequent API

call must use the svrurl returned by the authorization as the service address.

Specific service addresses list please refer to Appendix 2 svrrgnid and server address.

3.3.Authorization Process

After entering the above URL, the following interface appears:


Enter your LifeSmart account and password. After authentication, it will turn to the page

below:
Click the yellow button (Authorize) above to turn to auth_callback URL link. This URL includes

usertoken, userid and other parameters. Smart applications can read the usertoken and other

contents from the URL and then continue the following operations.

● Example of successful authorization return:

"code": "success",

"userid": "YOUR_USERID",

"usertoken": "YOUR_TOKEN",

"expiredtime": YOUR_EXPIRED_TIME,

"rgn": "USER_RGN",

"svrurl": "USER_SERVERURL",

"svrrgnid": "USER_SEVER_RGNID"

● Example of authorization failure return:

"code": "error",

"message": "ERR_MESSAGE"

Name Type Description

id int Message ID

userid string User ID

usertoken string User authentication token


expiredtime int Token expiration time, UTC timestamp, since January 1,

1970, in seconds

svrurl string API service address. We support multiple regions and

multiple services. The data of different users are distributed

on different services. The service URL determines the

service address that needs to be accessed to operate the

user data. When calling the API to manipulate user data,

please be sure to refer to the URL address returned by this

attribute. Otherwise you may not be able to access user

data correctly.

svrrgnid string The area ID of the user, such as "GS". Because of the

support for multiple areas, the area of different users may

be different. This attribute identifies the area where the user

is currently located.

3.4.Refresh Usertoken

The usertoken must be refreshed before the expiration time, otherwise the user must be re-

authorized.

a) Refresh URL: user’s svrurl + /auth.refreshtoken

E.g:
Obtained by user A after successful authorization:
svrurl="https://api.us.ilifesmart.com/app/",

Then the token refresh address of user A is:


https://api.us.ilifesmart.com/app/auth.refreshtoken
b) The HTTP request is POST, and the content is in JSON format

c) Request parameters:

Name Type Description

id int Message ID, it will return as it is after the call is successful

appkey string Appkey obtained when applying for a smart application

time int UTC timestamp, since January 1, 1970, in seconds

userid string The userid obtained when obtaining authorization

did string (Optional) Terminal unique id

sign string Signature value, signature algorithm see Note

d)
d) Signature original string:

appkey=***&did=***&time=***&userid=***&apptoken=***&usertoken=***

• Signature original string(except apptoken and usertoken is generated in alphabetical

order.

• usertoken is usertoken obtained when do authentication

e) Signature alogrithm is same as authentication

f) After the call is successful, the following information will be returned (JSON format):
Name Type Description

id int Message ID

code string 0: Successful;

Other: Error code;

message string If the code is equal to 0, it is empty, otherwise an error

message is returned

userid string User ID

usertoken string User authentication token

expiredtime int Token expiration time, UTC timestamp, since January 1,

1970, in seconds

g) E.g:

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● Request body:

{
"appkey": "APPKEY_XXXXXXXX",
"time": 1445307713,
"userid": "1111111",
"sign": "SIGN_XXXXXXXX",
"id": 12345
}

● Signature original string:

appkey=APPKEY_XXXXXXXX&time=1445307713&userid=1111111&apptoken=APPTOKEN_
XXXXXXXX&usertoken=USERTOKEN_XXXXXXXX

● Response:

{
"code": 0,
"message": "",
"id": 12345,
"userid": "1111111",
"usertoken": "NEW_USERTOKEN_YYYYYYYY",
"expiredtime": 1445955713
}
4.OpenAPI

4.1.HTTPS Request Specification

4.1.1.URL

Protocol: HTTPS

HTTP Method: POST

URL: Please use the server address returned by the authorization interface (svrurl field)

(American Region: https://api.us.ilifesmart.com/app/)

(European Region:https://api.eur.ilifesmart.com/app/)

Specific service addresses list please refer to Appendix 2 svrrgnid and server address.

4.1.2.Request Body JSON Format

id Message ID

ver Protocol version, now is "1.0"

lang Language, default is "en"


system
userid User id

appkey Application key


did (Optional) The unique id of the terminal,

if it is filled in during authorization, the

same id must be filled here

time UTC timestamp, the time calculated

since January 1, 1970, in seconds

sign Signature Value

method API request method name

The set of parameters used by the


params <attr>:<val>, ...... <attr>:<val>
method

method:Current support methods are as below:

Method URL Suffix Description

EpAddAgt api.EpAddAgt Add Smart Station

EpDeleteAgt api.EpDeleteAgt Delete Smart Station

EpGetAllAgts api.EpGetAllAgts Get All Smart Station

EpAdd api.EpAdd Pair or Add Sub Device

EpRemove api.EpRemove Delete Sub Devicie

Get other nearby smart devices searched by


EpSearchSmart api.EpSearchSmart
the Smart Station

EpAddSmart api.EpAddSmart Add the searched nearby smart devices to


the Smart Station

Obtain the Nearby IP Network Devices


EpSearchIDev api.EpSearchIDev
Searched By Smart Station

Get the nearby IP network Devices Searched


EpAddIDev api.EpAddIDev
By Smart Station.

Get all device information authorized to

appkey under this account. The device


EpGetAll api.EpGetAll
information does not include camera

information (if there is no camera permission)

EpGet api.EpGet Get a Device Information

EpSet api.EpSet Control smart device

EpsSet api.EpsSet Control multiple devices

EpCmd api.EpCmd Set Devices by Advanced Command

EpSetVar api.EpSetVar Set Devices by Low-Level Command

EpBatchSet api.EpBatchSet Set Multiple Device in Batch

EpGetAttrs api.EpGetAttrs Get Device extended attributes

EpTestRssi api.EpTestRssi Test RF Device Communication Quality

EpUpgradeAgt api.EpUpgradeAgt Upgrade Smart Station

EpRebootAgt api.EpRebootAgt Reboot Smart Station


EpGetAgtLatestVer api.EpGetAgtLatestVer Get the latest version of Smart Station
sion sion

EpGetAgtState api.EpGetAgtState Get the Smart Station status

View or maintain the list of OTA files on the

EpMaintOtaFiles api.EpMaintOtaFiles Smart Station that can be used to upgrade

the firmware version of the sub-device

View or maintain the task list of the current

EpMaintOtaTasks api.EpMaintOtaTasks sub-devices on the Smart Station that is

performing OTA upgrade.

Backup or restore configurations on Smart

EpMaintAgtRM api.EpMaintAgtRM Station, including all configuration data of

sub devices and AI

Set Smart Station configurations, including

EpConfigAgt api.EpConfigAgt whether allow local login, modify local

password etc

SceneGet api.SceneGet Get Scene

SceneSet api.SceneSet Trigger Scene

RegisterUser auth.RegisterUser Register a LifeSmart account

UnregisterUser auth.UnregisterUser Deauthorize a LifeSmart account

params: parameters used by the method


● ATTR_NAME: attribute name, find more detail in "LifeSmart Attribution of Smart Device"

● ATTR_VALUE: attribute value, find more detail in "LifeSmart Attribution of Smart Device"

4.1.4.Response JSON Format

Field Description

id Message ID

code Successful: 0;

Error: Check Error Message in Chapter 4.3

message If code==0, it indicates successful;

then return the result. Otherwise return error message

4.2.Security Policy

In order to ensure the security of communication with the Platform, this agreement requires

that all requests interacting via HTTPS must carry the signature information of the request

source, and the signature value is stored as sign in the system parameter set of the HTTPS

request.

The Platform first checks the time stamp information carried in the HTTPS request. If the

difference between the time and the cloud platform system time is greater than 5 minutes, it
will be regarded as an invalid request packet and an error code will be returned. When the

timestamp check is normal, the sign signature value is verified according to the unified

algorithm of the Platform, and the HTTPS request is received only when the signature value is

consistent.

In order to implement the above security mechanism, smart applications must apply for the

corresponding appkey and apptoken for the devices and applications they manage. For the

application method, see Chapter 2. Register Application.

4.2.1.Signature Algorithm

To complete the signature algorithm, the following two steps are required:

1. Collect the original signature string, "Signature Original Sring" = method+params

parameter set string (after all fields are arranged in ascending order, all field names and

corresponding values are connected in turn) + did string in the system parameter set (if

any) + time string +userid+usertoken+appkey+apptoken, the style is as follows:

"<attr>:<val>,...,<attr>:<val>,did:<val>,time:<val>,userid:<val>,usertoken:<val>,appkey:<val>,
apptoken:<val>"

2. Encrypt the "signature string ” using MD5 and convert it into a 32-bit hexadecimal

lowercase string as the sign signature value.

Note:
● Before Application accesses to the Platform, it must obtains the appkey and apptoken, see

Chapter 2. Register Application.

● The Application manages the user's device, first the LifeSmart user authorizes the Application, the

Application obtains the user token, and obtains the operation authority.

● The Application development form is not limited, it can be Android, iOS, Web or background

program.

4.2.2.Signature Sample

•Request body:

{
"id": 123456,
"system":
{
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"did": "DID_XXXXXXXX",
"time": 1445307713,
"appkey": "APPKEY_XXXXXXXX"
},
"method": "TestMethod",
"params":
{
"param1": "12345",
"param2": "abcde"
}
}
Sort param1 and param2 in the params part in ascending order to form a string without

spaces, add method before the string, and finally concatenate did, time, userid, usertoken,

appkey, and apptoken. The Signature Original String:

"method:TestMethod,param1:12345,param2:abcde,did:DID_XXXXXXXX,time:1445307713,use
rid:1111111,usertoken:abcdefghijklmnopqrstuvwx,appkey:APPKEY_XXXXXXXX,apptoken:ABC
DEFGHIKJLMJOBPOOFPDFDA"

Signature Value calculate MD5 value as:

sign=MD5("method:TestMethod,param1:12345,param2:abcde,did:DID_XXXXXXXX,time:1445
307713,userid:1111111,usertoken:abcdefghijklmnopqrstuvwx,appkey:APPKEY_XXXXXXXX,app
token:ABCDEFGHIKJLMJOBPOOFPDFDA")

Then the final sign value is

2602efca4b1924fb1a7e62b78f2285b2

Note:

Errors frequently encountered in interface requests return "sign error". The general reasons are as

follows:

• Carefully check the generation method of the original signature string of the document, and pay

attention to whether the splicing characters of the parameters in the params are correct;

• Whether the did parameter is passed in when the user is authorized to obtain the usertoken, and the

field information needs to be consistent when requesting the interface;

• The usertoken is invalid, that is, the usertoken passed in through the interface is wrong or expired,

whether the token refresh operation has been performed, etc.


4.3.Error Code

Error Code Error Message

0 Success

10001 Request params error

10002 Appkey doesn’t exist

10003 Not support HTTP Get request

10004 Invalid signature

10005 No authenticated by user

10006 User authentication timeout

10007 Illegal access

10008 Internal error

10009 Failed to set attribution

10010 Illegal method

10011 Operation timeout

10012 Account name already exists

10013 Device offline

10014 Device has been registered by other account


10015 Not enough authority

10016 Device not support operation

10017 Illegal data

10018 No permission for GPS location

10019 Object doesn’t exist

10020 Device has exist on account

10022 The request address need to be redirected.

4.4.Device Model

In order to facilitate the understanding of the API, here we give a brief description of the

LifeSmart device model and explain some terms.

Let's take the data obtained by EpGet or EpGetAll request as an example:

"name": "Smart Switch",

"agt": "A3EAAABtAEwQXXXXXXXXXX",

"me": "2d11",

"devtype": "SL_SW_IF3",

"fullCls": "SL_SW_IF3_V2",

"stat": 1,

"data": {
"L1": {"type": 129, "val": 1,"name": "Living"},

"L2": {"type": 128, "val": 0,"name": "Study"},

"L3": {"type": 129, "val": 1,"name": "Kid"},

},

We define the following model:

• Smart Station (Agt): "A3EAAABtAEwQXXXXXXXXXX"

• Device (EP): "2d11" , It is a triple switch of type SL_SW_IF3

• Device Attribute(IO): Device attributes can be used to read status and control behavior.

L1, L2, and L3 are all IO ports of the device. Of course, for read-only IO ports such as

temperature sensors, you can only read status, but not control.

• Management object (MO): Refers to the general term of the above devices, and also

includes AI objects, that is, MO can be a Smart Station, or a device or IO port, AI, etc.

• Smart Device (SmartDevice): Smart devices refer to devices that can work

independently, such as traditional smart stations, and Wi-Fi products that can work

independently, such as cameras, SPOT, etc.

Note:

• Wi-Fi devices that can work independently can be added to the Smart Station through

EpSearchSmart, EpAddSmart methods. At this time, the Smart Station will be used as a sub-

device (Ep) under the Smart Station. After being added to the Smart Station, smart device will be

able to participate in the AI configuration of the Smart Station together with other devices.
• The smart device itself has agt attribute, but after being added to the Smart Station, its identity is

as a sub-device, its own agt attribute will be hidden, and its own agt attribute can be obtained

through Ep device attribute: agt_self.

• After the smart device is added to the Smart Station, calling EpGetAllAgts will not return.

Here are the definitions of device attributes below:

Name Type Description

agt string Smart Station ID

agt_ver string Smart Station version number

tmzone int32 Smart Station time zone setting

me string Device ID (only under the Smart Station)

devtype string Device Type (device specification)

fullCls string The complete device Type including the version number,

generally its value is equal to devtype+V[n]. V[n] indicates its

version number information. In general, devtype can be used

to identify the device Type. You need to use fullCls when you

need to distinguish the features of different versions of the

device. If the device Type does not have version information,

fullCls may be the same as devtype.

name string Device name

stat int32 Device online status


Name Type Description

0: Offline

1: Online

data collection/ma The IO port collection under the device is a Map dictionary

p collection. The key is the name of the IO port (idx), and the

value is the data of the IO port

data[IDX].type int32 The value of a specific IO port Type

data[IDX].val int32 The value of a specific IO port

data[IDX].v float32 Friendly value of specific IO port

The friendly value refers to a value that is easy for

users to understand.

For example temperature: val returns 235, and its

friendly value v is 23.5, indicating that the current

temperature is 23.5 degrees Celsius;

Note:

• You can also refer to the "LifeSmart Attribution

of Smart Device" document, and the actual friendly

value can also be calculated based on the type and

val values.

• When calling the EpSet series interface control

device, the value of val is still required. For example,


Name Type Description

set the temperature of the air conditioner to tT to 26

degrees, and the val of tT to be set to 260. For

details, please refer to the "LifeSmart Attribution of

Smart Device" document.

data[IDX].name string The name of the specific IO port. (Note: if the IO port has

not been named, this attribute value will not be returned)

lHeart int32 The last heartbeat time of the device; UTC timestamp, since

January 1, 1970, in seconds.

lDbm int32 The dBm value of the device, its value is negative, the closer

the value is to 0, the better the signal quality. Note that this

attribute refers to the signal strength of radio frequency

devices, and Wi-Fi devices will not have this attribute value.
Name Type Description

agt_self string The "agt" attribute of the smart device itself. If a smart

device (for example camera, SPOT) is added to the Smart

Station and used as a device, the original agt attribute of the

smart device will be hidden. When this attribute value is

displayed, the agt_self attribute will be used. The EpGetAll

method will return the value of this attribute, if it exists.

Or a device A is cascaded to other Smart Station to use is

device B, then device B will have agt_self attribute, and its

value indicates device A's own agt attribute

me_self string The "me" attribute of the smart device itself. If a smart

device (for example camera, SPOT) is added to the

Smart Station as a sub-device, the original me

attribute of the smart device will be hidden, and the

me_self attribute will be used when displaying this

attribute value. The EpGetAll method will return the

value of this attribute if it exists.

Or a device A is cascaded to other Smart Station to

use is device B, then device B will have the me_self

attribute, and its value indicates the original me

attribute of device A
Name Type Description

ext_loc string Device extended attributes, third-party applications

can use this field to store the required extended

attributes. Note: The maximum length of this field

cannot exceed 512 characters, and it must be a string

Type.

This field is dedicated to third-party applications, and

LifeSmart APP does not need to use this field.

ver string Device firmware version

4.5.OpenAPI Interface Specifications

4.5.1.EpAddAgt (Add Smart Station)

4.5.1.1.Request Specification

Type Definition Must Description

Interface Name EpAddAgt Add Smart Station

Partial URL api.EpAddAgt


Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

appkey Y appkey
system
did O (Optional) The unique id of

the terminal. If it is filled in

during authorization, the

Request Content same id must be filled here

time Y UTC timestamp, since

January 1, 1970, in seconds

method Y EpAddAgt

params sn Y The AGT field obtained

through the discovery

protocol or the barcode on

the back of the Smart Station

name Y Smart Station name


id Y Message ID

4.5.1.2.

4.5.1.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpAddAgt

● Request body:

{
"id": 957,
"method": "EpAddAgt",
"params": {
"sn": "xxxxxxxx",
"name": "xxx"
},
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}

● Signature original string:

method:EpAddAgt,name:xxx,sn:xxxxxxxx,time:1447641115,userid:1111111,usertoken:USERT
OKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 957,
"code": 0,
"message": [
{
"agt": "A3EAAABdADQQXXXXXXXXXXX",
"name": "My Smart Station"
}
]
}

4.5.2.EpDeleteAgt (Delete Smart Station)

4.5.2.1.Request Specification

Type Definition Must Description

Interface Name EpDeleteAgt Delete Smart Station

Partial URL api.EpDeleteAgt


Content Type application/json

HTTP Method HTTP POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique


system
id of the terminal. If it

is filled in during
Request Content
authorization, the same

id must be filled here

time Y UTC timestamp, since

January 1, 1970, in

seconds

method Y EpDeleteAgt

params agt Y Smart Station ID

id Y Message ID
4.5.2.2.

4.5.2.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpDeleteAgt

● Request body:

{
"id": 957,
"method": "EpDeleteAgt",
"params": {
"agt": "A3EAAABdADQQXXXXXXXXXXX"
},
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}
● Signature original string:

method:EpDeleteAgt,agt:A3EAAABdADQQXXXXXXXXXXX,time:1447641115,userid:1111111,
usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_
XXXXXXXX

● Response:

{
"id": 957,
"code": 0,
"message": "success"
}

4.5.3.EpGetAllAgts (Get All Smart Station)

4.5.3.1.Request Specification

Type Definition Must Description

Interface Name EpGetAllAgts Get All Smart Station

Partial URL api.EpGetAllAgts

Content Type application/json

HTTP Method POST

ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique id of

the terminal. If it is filled in

during authorization, the

same id must be filled here

time Y UTC timestamp, since

January 1, 1970, in seconds

method Y EpGetAllAgts

id Y Message ID

4.5.3.2.

4.5.3.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:
svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGetAllAgts

● Request body:

{
"id": 957,
"method": "EpGetAllAgts",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}

● Signature original string:

method:EpGetAllAgts,time:1447641115,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,
appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 957,
"code": 0,
"message": [
{
"agt": "A3EAAABdADQQXXXXXXXXXXX",
"name": "My Smart Station",
"agt_ver": "1.0.33p1",
"stat": 1,
"tmzone": 8,
}
]
}

4.5.4.EpAdd (Add Sub Device)

4.5.4.1.Request Specification

Type Definition Must Description

Interface Name EpAdd Add Sub Device

URL api.EpAdd

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

Request Content system sign Y Signature Value

userid Y User id

appkey Y appkey
did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1,

1970, in seconds.

method Y EpAdd

agt Y Smart Station ID, is return value of

EpGetAllAgts

optarg O Add additional device parameters.

params This is an optional and advanced

option. See description below.

The data Type is the serialized

string of the JSON object.

id Y Message ID

4.5.4.2.

Note:

RF device needs to be added to the Smart Station to operate. When adding a RF device, it is

necessary to pair the code, so the device to be added and the Smart Station enter the corresponding

channel, and the identification and matching of the other party is considered complete. The code
matching process has a timeout period. The time is defined as 20 seconds by default. Therefore, it is

necessary to grasp the time so that the time interval between the device entering the code matching

state and calling the EpAdd method is as short as possible.

4.5.4.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpAdd

● Request body:

{
"id": 829,
"method": "EpAdd",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447643442,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "A3EAAABdADQQXXXXXXXXXX"
}
}

● Signature original string:

method:EpAdd,agt:A3EAAABdADQQXXXXXXXXXX,time:1447643442,userid:1111111,userto
ken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXX
XXX

● Response:

{
"id": 829,
"code": 0,
"message":{
"me": "271c"
}
}

Note:

Returning the message.me attribute means the me attribute of the newly added device.

4.5.4.3.optarg Parameter

optarg parameter is an additional parameter for adding a device. Generally, it can work well

without using this parameter, but for some devices, in order to achieve flexible customization,

this parameter can be used.


This parameter is closely related to the device type. Different devices have different

parameters. If the device has no additional parameters, the value of this parameter will be

ignored. The currently available additional parameters are as follows:

CUBE environmental sensor

optarg = {
"cls":"SL_SC_BE",
"exarg":{
"humidity_display":1/2/3,
"temperature_display":1/2/3
}
}

humidity_display: attribute is used to determine the content displayed on the LCD screen of

the CUBE environmental sensor, which can be displayed as humidity, illumination, humidity

and illumination, corresponding to values 1, 2, and 3 respectively.

temperature_display attribute is used to determine the selection of the temperature display

category on the LCD screen of the multi-function (CUBE) environmental sensor. You can

select Celsius, Fahrenheit, Celsius and Fahrenheit, corresponding to values 1, 2, and 3

respectively.

CUBE motion sensor

optarg = {
"cls":"SL_SC_BM",
"exarg":{
"warning_duration":[6-814]
}
}
warning_duration: attribute is used to determine the alarm duration (unit: seconds) after the

movement is detected. The default is seconds, and the optional range is 6-814 seconds.

Yale door lock module

optarg = {
"cls":"SL_LK_YL",
"exarg":{
"enable_remote_unlock":1/0
}
}
enable_remote_unlock: attribute is used to determine whether the Yale door lock module

supports remote door opening. You can choose to support, not support, corresponding to

the values 1, 0 respectively.

Stellar Switch/Starry Switch/Polar Switch/Switch Accessory

When adding Stellar Switch/Starry Switch/Polar Switch/Switch Accessory, the specification

must be specified, otherwise it cannot be added correctly

At the same time, the Stellar Switch/Starry Switch/Polar Switch can also set the working

mode, respectively is: speed priority, power priority. Its configuration is as follows:

optarg = {
"cls":"SL_MC_ND3_V2",
"exarg":{
"mode_selection":"speed"
}
}
cls indicates that its Polar Switch (L 3 way)

The cls of current Stellar Switch/Starry Switch/Polar Switch/Switch Accessory are defined as

follows:

● SL_SW_ND1_V1/SL_SW_ND2_V1/SL_SW_ND3_V1 Stellar Switch /Starry Switch


(1 way/2way/3way)
● SL_MC_ND1_V1/SL_MC_ND2_V1/SL_MC_ND3_V1 Stellar Switch /Starry Switch
Accessory (1 way/2way/3way)
● SL_SW_ND1_V2/SL_SW_ND2_V2/SL_SW_ND3_V2 Polar Switch (1
way/2way/3way)
● SL_MC_ND1_V2/SL_MC_ND2_V2/SL_MC_ND3_V2 Polar Switch Accessory (1
way/2way/3way)

mode_selection: attribute indicates the working mode. You can select "speed" and "power",

which correspond to speed priority and power priority respectively. The default mode is

speed priority.

Specially specified device

Some devices must specify the type when pairing the code, so that the API interface can

perform better adding operations. Therefore, when adding these devices, please specify the

type of device specification to be added in the optarg attribute.

The current mandatory device specifications are as follows:

● PSM: PSM series


● SL_P_IR: SPOT(MINI)
Let's take Starry Switch as an example, the parameters are as follows:

optarg = {

"cls":"SL_SW_ND1"

Note:

The parameter data format is the serialized string of the JSON object, and it must participate in the

method signature.

4.5.5.EpRemove (Delete Device)

4.5.5.1.Request Specification

Type Definition Must Description

Interface Name EpRemove Delete Device

Partial URL api.EpRemove

Content Type application/json

HTTP Method POST

ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique id of

the terminal. If it is filled in

during authorization, the

same id must be filled

here.

time Y UTC timestamp, since

January 1, 1970, in

seconds.

method Y EpRemove

agt Y agt of the device to be

deleted, it is the

information when EpGetAll

returns
params
me Y me of the device to be

deleted, it is the

information when EpGetAll

returns
id Y Message ID

4.5.5.2.

4.5.5.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpRemove

● Request body:

"id": 46,
"method": "EpRemove",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447642457,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "A3EAAABdADQQXXXXXXXXXX",
"me": "2832"
}

● Signature original string:

method:EpRemove,agt:A3EAAABdADQQXXXXXXXXXX,me:2832,time:1447642457,userid:
1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTO
KEN_XXXXXXXX

● Response:

{
"id": 46,
"code": 0,
"message": "success"
}

4.5.6.EpGetAll (Get All Device Information)

4.5.6.1.Request Specification

Type Definition Mus Description

t
Interface Name EpGetAll Get all device information

authorized to appkey under this

account. The device information

does not include camera

information (if there is no camera

permission).

Partial URL api.EpGetAll

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User id

Request Content system


appkey Y appkey

did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must

be filled here.
time Y UTC timestamp, since January 1,

1970, in seconds.

method Y EpGetAll

params degree N degree: The degree of detail

returned by the query, if not

provided, the default is 2.

0: Return the most basic

information, including

agt,me,devtype,name,stat

1: Return data

2: Return agt_ver, lDbm, lHeart

3: return agt_self

id Y Message ID

4.5.6.2.

4.5.6.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;


● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGetAll

● Request body:

{
"id": 144,

"method": "EpGetAll",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447396020,
"sign": "SIGN_XXXXXXXX"
}
}

● Signature original string:

method:EpGetAll,time:1447395539,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,app
key:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 144,
"code": 0,
"message": [{

"agt": "A3EAAABdADQQXXXXXXXXXX",
"me": "2711",
"devtype": "SL_SW_IF2",
"name": "switch",
"stat": 1,
"data": {
"L1": {"type": 129,"val": 1,"name": "light11"},

"L2": {"type": 128,"val": 0,"name": "light12"},


},

"lDbm": -35,

"lHeart": 1539143970
},{

"agt": "A3EAAABdADQQXXXXXXXXXX",

"me": "2713",
"devtype": "SL_LI_RGBW",
"name": "bulb",

"ext_loc": "{\"key\": \"LS\", \"location\": "HangZhou"}",


"stat": 1,
"data": {
"RGBW": {"type": 255,"val": 2147483648},

"DYN": {"type": 254,"val": 0}


},

"lDbm": -46,

"lHeart": 1539143970
}]
}

Note:

If the ext_loc attribute exists, the ext_loc attribute value will be returned.
4.5.7.EpGet (Get a Device Information)

4.5.7.1.Request Specification

Type Definition Must Description

Interface Name EpGet Get a Device Information

Partial URL api.EpGet

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User id

appkey Y appkey
Request Content system

did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must

be filled here.

time Y UTC timestamp, since January 1,


1970, in seconds.

method Y EpGet

params agt Y Smart Station ID, is the

information returned by

EpGetAll

me Y Device ID,is the information

returned by EpGetAll

Id Y Message ID

4.5.7.2.

4.5.7.2. Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGet
● Request body:

{
"id": 974,
"method": "EpGet",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "A3EAAABdADQQXXXXXXXXXX",
"me": "2711"
}
}

● Signature original string:

method:EpGet,agt:A3EAAABdADQQXXXXXXXXXX,me:2711,time:1447639497,userid:111111
1,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN
_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": [
{

"agt": "A3EAAABdADQQXXXXXXXXXX",
"me": "2711",
"devtype": "SL_SW_IF2",
"name": " Blend Switch ",
"stat": 1,
"data": {
"L1": {"type": 129,"val": 1,"name": " living room"},

"L2": {"type": 128,"val": 0,"name": " dinning room "},


},

"lDbm": -35,

"lHeart": 1539143970
}]

4.5.8.EpSet (Control Smart Device)

4.5.8.1.JSON Request Specification

Type Definition Must Description

Interface Name EpSet Control smart device

Partial URL api.EpSet

Content Type application/json

HTTP Method POST

Request Content system ver Y 1.0


lang Y en

sign Y Signature Value

userid Y User id

appkey Y appkey

did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1, 1970,

in seconds.

method Y EpGet

agt Y Smart Station ID, is the information

returned by EpGetAll

me Y Device ID,is the information

returned by EpGetAll
params

… Y Different parameters are passed in

according to different devices, please

refer to "LifeSmart Attribution of

Smart Device" for details


nonVolatil O Set to keep data if device is powered

e down or not. (1: Yes)

Note:

Only some devices support this

function.

bandResu O Take the newest IO ports setting in

lt response or not. (1: Yes)

Note:

Some devices may not reponse the

newest IO ports setting.

id Y Message ID

4.5.8.2.

4.5.8.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:


https://api.us.ilifesmart.com/app/api.EpSet

● Request body:

{
"id": 191,
"method": "EpSet",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447640772,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "A3EAAABdADXXXXX0Njg5NA",
"me": "2832",
"idx": "RGBW",
"type": 0x80,

"val": 0,

"tag": "m"
}
}

● Signature original string:

method:EpSet,agt:A3EAAABdADXXXXX0Njg5NA,idx:RGBW,me:2832,tag:m,type:0x80,val:
0,time:1447640772,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_X
XXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:
{
"id": 191,
"code": 0,
"message": "success"
}

Note:How to change the name of device, IO port and Smart Station?

The EpSet supports changing the name of device, IO port and Smart Station.
Modify device name: Please specify {agt,me,name} property;
Modify device’s IO port name: Please specify {agt,me,idx,name} property;
Modify Smart Station name: Please specify {agt,me='NULL',name} property;

E.g {agt="A3EAAABdADXXXXX0Njg5NA",me="2d32", name="my plug"}


Means name device 2d32 as " my plug";
E.g {agt="A3EAAABdADXXXXX0Njg5NA",me="2d33", idx="L1", name="living room light"}
Means name the first way switch of this 2d33 3-way switch as" living room light ";
E.g{agt="A3EAAABdADXXXXX0Njg5NA",me="NULL", name="my Smart Station"}
Means name A3EAAABdADXXXXX0Njg5NA Smart Station as " my Smart Station";

Note:
Not all IO port names make sense. Currently, IO port name is meaningful for multi-control switch like
3-way BLEND Light Switch.
Note:
me must be "NULL" when modify Smart Station name.

Note: How to modify device’s ext_loc property?


The EpSet support to modify device’s value of ext_loc property.
Modify ext_loc: Please specify {agt,me,ext_loc} property;

E.g {agt="A3EAAABdADXXXXX0Njg5NA",me="2d32", ext_loc="{\"key\": \"LS\", \"location\":


"HangZhou"}"}
It shows the device’s ext_loc is changed to “{\"key\": \"LS\", \"location\": "HangZhou"}".

Note:
"ext_loc" can be modify with "name" as same time by specifying both value.
4.5.9.EpsSet (Control Multiple Devices)

4.5.9.1.Request Specification

Type Definition Must Description

Interface Name EpsSet Control multiple devices

Partial URL api.EpsSet

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

Request Content system


appkey Y appkey

did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must be

filled here.
time Y UTC timestamp, since January 1,

1970, in seconds.

method Y EpsSet

args Y To set the execution list, each

content in the list refers to the

params parameter of EpSet;

Need to convert the list into a

JSON format string and assign it to

args.

nonVolatil O Set to keep data if device is

e powered down or not. (1: Yes)

params Note:

Only some devices support this

function.

bandResu O Take the newest IO ports

lt setting in response or not. (1:

Yes)

Note:

Some devices may not reponse

the newest IO ports setting.

id Y Message ID
4.5.9.2.

4.5.9.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpsSet

● Request body:

"id": 191,

"method": "EpsSet",

"system": {

"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447640772,

"sign": "SIGN_XXXXXXXX"

},

"params": {

"args": "[{\"val\":65535,\"tag\":\"m\",\"agt\":\"_-

EAAABuAXXXXXXyOTc2Mg\",\"me\":\"0011\",\"idx\":\"RGBW\",\"type\":255},{\"val\":0,

\"tag\":\"m\",\"agt\":\"_-

EAAABuAXXXXXXyOTc2Mg\",\"me\":\"0011\",\"idx\":\"DYN\",\"type\":128}]",

● Signature original string:

method:EpsSet,args:[{"val":65535,"tag":"m","agt":"_-
EAAABuAXXXXXXyOTc2Mg","me":"0011","idx":"RGBW","type":255},{"val":0,"tag":"m","ag
t":"_-
EAAABuAXXXXXXyOTc2Mg","me":"0011","idx":"DYN","type":128}],time:1447640772,useri
d:1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APP
TOKEN_XXXXXXXX

● Response:

{
"id": 191,
"code": 0,
"message": "success"
}
4.5.10.SceneGet (Get Scene )

4.5.10.1.Request Specification

Type Definition Must Description

Interface Name SceneGet Get Scene

Partial URL api.SceneGet

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

Request Content system sign Y Signature Value

userid Y User ID

appkey Y appkey
did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1, 1970,

in seconds.

method Y SceneGet

params agt Y Smart Station ID

id Y Message ID

4.5.10.2.

4.5.10.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:


https://api.us.ilifesmart.com/app/api.SceneGet

● Request body:

{
"id": 974,
"method": "SceneGet",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",
}
}

● Signature original string:

method:SceneGet,agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USERT
OKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": [
{
"id": "AI_1608888900",
"name":"Scene A",
"desc":"Scene A",
"cls":"scene",
},
{
"id": "AI_1608888900",
"name":"Scene B",
"desc":"Scene B",
"cls":"scene",
}
]

4.5.11.SceneSet (Trigger Scene)

4.5.11.1.Request Specification

Type Definition Must Description

Interface Name SceneSet Trigger Scene

Partial URL api.SceneSet

Content Type application/json

HTTP Method POST

ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique id of the

terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1,

1970, in seconds.

method Y SceneSet

agt Y Smart Station ID

id Y Id of the scene to be triggered, as

the returned data of SceneGet

params
type O Parameter value of the scene to be

set

RGBW O Parameter value of the scene to be

set

id Y Message ID
4.5.11.2.

4.5.11.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.SceneSet

● Request body:

{
"id": 974,
"method": "SceneSet",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",
"id": "aaaaaaaa",
}
}

● Signature original string:

method:SceneGet,agt:AGT_XXXXXXXX,id:aaaaaaaa,time:1447639497,userid:1111111,usert
oken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXX
XXXX

● Response:

{
"id": 974,
"code": 0,
"message":"success"
}
4.5.11.3.Instruction

The cls of the scene are mainly as follows, and the corresponding parameters need to be

passed in when the scene is executed at the same time:

cls name args value value Description desc

scene Scene N/A N/A N/A

groupsw One click args type 0x81:ON Turn on/off one group

to switch 0x80:OFF of lights

grouphw Quick args type 0x81:ON Set a group of lights.

Lighting 0x80:OFF This mode use

Group 0xff:Set light’s color broadcast to turn

and turn it on on/off lights, which is

0xfe:Set light’s color much faster.

and turn it off

RGBW 4byte:WRGB

grouprgbw Light args type 0x81:ON Turn on/off one group

Group 0x80:OFF of lights or switches.

0xff:Set light’s color

and turn it on

0xfe:Set light’s color


and turn it off

RGBW 4byte:WRGB

4.5.12.EpUpgradeAgt (Upgrade Smart Station)

4.5.12.1.Request Specification

Type Definition Must Description

Interface EpUpgradeAgt Upgrade Smart Station

Name

Partial URL api.EpUpgradeAgt

Content Type application/json

HTTP Method POST

Request ver Y 1.0


system
Content lang Y en
sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpUpgradeAgt

params agt Y Smart Station ID

httpUrl O Use HTTP to upgrade and download the

firmware in URL, notice the firmware file

need to ends in .tar.gz

httpCertifi O Security digest certificate must be provided

cate if adopt HTTP upgrade. Notice: certificate

content must apodt standard Base64 code.

reboot O Whether reboot Smart Station automatically

or not after upgrade.(=1,need;=0, needn’t;

The default is 1)
nonResp O Whether wait for Smart Station complete

execution or not, and response immediately.

(=1,need;=0, needn’t; The default is 1)

id Y Message ID

4.5.12.2.

4.5.12.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpUpgradeAgt

● Request body:

{
"id": 974,
"method": "EpUpgradeAgt",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",
"reboot": "1",
}
}

● Signature original string:

method:EpUpgradeAgt,agt:AGT_XXXXXXXX,reboot:1,time:1447639497,userid:1111111,usert
oken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXX
XXXX

● Response:

{
"id": 974,
"code": 0,
"message":"success"
}

Note:

Since the upgrade operation is a relatively time-consuming operation, it is also related to network

reasons, so the network environment is bad and the time may take several minutes, so the command
default (nonResp=1) will not wait for the device upgrade to complete before returning, but Return now.

Therefore, the caller needs to call query commands such as EpGetAllAgts at intervals to query and

obtain the version number of the Smart Station to determine whether it has been upgraded to the

latest version.

If nonResp=1 and reboot=0, the command will return immediately, but will not restart automatically, so

you will not be able to grasp the upgrade status of the Smart Station, so it is best not to use this

method.

If nonResp=0, it means that you need to wait for the upgrade result of the Smart Station, and reboot is

best not to be equal to 1, because the Smart Station automatically restarts after the upgrade is

completed, which may cause the response packet to fail to be sent. And in the nonResp=0 mode,

because it takes a long time, it is necessary to set the HTTP request waiting time to a longer time,

such as 300s, otherwise the HTTP request may return early and time out.

Therefore, the recommended methods are:

nonResp=1, reboot=1: Do not pay attention to the result of the upgrade. After the command goes down,
it will return immediately, the default mode.

nonResp=0, reboot=0: Pay attention to the upgrade result. After the upgrade is completed, you need
to manually call EpRebootAgt to execute the restart command, and you need to set the HTTP request
waiting time to a longer time.

Current version of Smart Station, please reference to EpGetAllAgts API response Smart Station

agt_ver property.
4.5.13.EpRebootAgt (Reboot Smart Station)

4.5.13.1.Request Specification

Type Definition Must Description

Interface EpRebootAgt Reboot Smart Station

Name

Partial URL api.EpRebootAgt

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

Request
appkey Y appkey
system
Content
did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.
method Y EpRebootAgt

params agt Y Smart Station ID

id Y Message ID

4.5.13.2.

4.5.13.3.

4.5.13.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpRebootAgt

● Request body:

{
"id": 974,
"method": "EpRebootAgt",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX"
}
}

● Signature original string:

method:EpRebootAgt,agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USE
RTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":"success"
}

Note:

EpUpgradeAgt can automatically reboot. Therefore, to perform the EpUpgradeAgt operation, there is

generally no need to additionally call the EpRebootAgt operation.


4.5.14.EpGetAgtLatestVersion (Get the latest Version of Smart

Station)

4.5.14.1.Request Specification

Type Definition Must Description

Interface EpGetAgtLatestVersi Get the latest version of Smart Station

Name on

Partial URL api.EpGetAgtLatestV

ersion

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

Request
system sign Y Signature Value
Content

userid Y User ID

appkey Y appkey
did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpGetAgtLatestVersion

params agt Y Smart Station ID

id Y Message ID

4.5.14.2.

4.5.14.3.

4.5.14.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:
svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGetAgtLatestVersion

● Request body:

{
"id": 974,
"method": "EpGetAgtLatestVersion",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX"
}
}

● Signature original string:

method:EpGetAgtLatestVersion,agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,user
token:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXX
XXXX

● Response:

{
"id": 974,
"code": 0,
"message":{
"newestVersion": "NEWEST_VERSION",
"stableVersion":"STABLE_VERSION",
}
}

Response Description:

* newestVersion: The current latest version. The latest version currently released does not

force users to upgrade, users are free to choose, they can choose to upgrade, or they can

choose to ignore, generally experience the latest features or small bug fixes will update the

latest version.

* stableVersion: The current stable version. If the current version number of the Smart

Station is lower than the stable version, users must be reminded to upgrade the version

number of the Smart Station. Generally, the stable version will be updated with major feature

updates or major bug fixes.

Note:

For the current version number of the Smart Station, please refer to the agt_ver attribute of the Smart

Station returned by the EpGetAllAgts response.


4.5.15.EpSearchSmart (Search for nearby Smart Devices)

4.5.15.1.Request Specification

Type Definition Must Description

Interface EpSearchSmart Get other nearby smart devices searched by

Name the Smart Station.

When you need to add other Wi-Fi smart

devices, such as cameras and Super Bowls,

to the Smart Station, you need to execute

this interface first, and then call the

EpAddSmart interface to add the searched

Wi-Fi smart devices to the Smart Station.

Partial URL api.EpSearchSmart

Content Type application/json

HTTP Method POST

ver Y 1.0

Request lang Y en
system
Content sign Y Signature Value

userid Y User ID
appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpSearchSmart

agt Y Smart Station ID

mode Y Search mode. The value can be "notexist" or

"auto".

"notexist" means the smart devices found


params
by Smart Station , which is still not added

into the current Smart Staion.

"auto" means all devices Smart Staion

found.

id Y Message ID

4.5.15.2.

4.5.15.2.Example

● We suppose:
appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpSearchSmart

● Request body:

{
"id": 974,
"method": "EpSearchSmart",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"mode": "notexist"
}
}
● Signature original string:

method:EpSearchSmart,agt:AGT_XXXXXXXX,mode:notexist,time:1447639497,userid:11111
11,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN
_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":[{

"lsid": "_wQBANxPIiTZEAAAAAAAAA",

"name": "SPOT",

"ip": "192.168.1.56",

"ttl": 1,

"sn": "dc:4f:22:24:d9:10"

},{

"lsid": "A9cAAEJDMzQwMDJGQTMzOA",

"name": "Camera",

"ip": "192.168.1.224",

"ttl": 1

}
]
}

Response Description:

* lsid : The UUID of the smart device that is searched;

* name: The name of the smart device that is searched;

* ttl: The number of TTLs in the search process, which can be used to diagnose the network;
* sn: The MAC address of the smart setting that is searched, it does not always exist;

4.5.16.EpAddSmart (Add the searched Smart Devices)

4.5.16.1.Request Specification

Type Definition Must Description

Interface EpAddSmart To add the searched nearby smart devices

Name to the Smart Station, you need to call

EpSearchSmart to get the searched nearby

smart device list fiest. For details, please

refer to the EpSearchSmart interface

description.

Partial URL api.EpAddSmart

Content Type application/json

HTTP Method POST

ver Y 1.0

Request
system lang Y en
Content

sign Y Signature Value


userid Y User ID

appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpAddSmart

agt Y Smart Station ID

lsid Y The LifeSmart UUID of the smart device to

be added, is obtained from the smart device

information returned by the EpSearchSmart


params
interface.

ip Y The IP of the smart device to be added, is

obtained from the smart device information

returned by the EpSearchSmart interface.

name Y The Name of the smart device to be added,

you can name it yourself, not necessarily

have to be equal to the name of the smart

device returned by the EpSearchSmart


interface.

id Y Message ID

4.5.16.2.

4.5.16.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpAddSmart

● Request body:

{
"id": 974,
"method": "EpAddSmart",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"lsid": "A9IAAEJDMzQwMDJGMUY3QQ",

"ip": "192.168.1.145",

"name": "CameraByOpenApi",
}
}

● Signature original string:

method:EpAddSmart,agt:AGT_XXXXXXXX,ip:192.168.1.145,lsid:A9IAAEJDMzQwMDJGMU
Y3QQ,name:CameraByOpenApi,time:1447639497,userid:1111111,usertoken:USERTOKEN_
XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":"2d3a"
}

Response Description:
● If success, the message attribute identifies the "me" attribute value of the newly added

smart device under the Smart Station.

● If the device already exists under the Smart Station, which means it has been added, the

message will still return the "me" attribute value of the device under the old Smart

Station.

4.5.17.EpGetAgtState (Get the Smart Station status)

4.5.17.1.Request Specification

Type Definition Must Description

Interface EpGetAgtState Get the Smart Station status

Name

Partial URL api.EpGetAgtState

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

Request
system sign Y Signature Value
Content

userid Y User ID

appkey Y appkey
did O (Optional) The unique id of the terminal. If

it is filled in during authorization, the same

id must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpGetAgtState

params agt Y Smart Device ID

id Y Message ID

4.5.17.2.

4.5.17.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGetAgtState
● Request body:

{
"id": 974,
"method": "EpGetAgtState",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX"
}
}

● Signature original string:

method:EpGetAgtState,agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:US
ERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": {

"state": 2,

"agt_ver": "1.0.68p8",
"name": "智慧中心 MINIV2"

}
}

Response Description:

Smart devices refer to devices that have the ability to work independently, such as Smart

Station, Smart Station MINI, and Wi-Fi independent working devices, such as SPOT, cameras,

etc.

There are three states of smart devices, and descriptions of the value are as follows:

• 0: offline;

• 1: Initializing;

• 2: normal;

Initializing generally occurs during the process of adding Smart Devices, When Smart Device

has been added to the account, but the initialization has not been completed.

4.5.18.EpCmd (Set Devices by Advanced Command)

4.5.18.1.Request Specification

Type Definition Must Description

Interface EpCmd Set Devices by Advanced Command


Name

Partial URL api.EpCmd

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

appkey Y appkey
system

did O (Optional) The unique id of the terminal. If it

Request is filled in during authorization, the same id

Content must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpCmd

agt Y Smart Station ID

params me Y Device ID

cmd Y Command string


cmdargs O Command parameter, serialized string of

JSON format object

id Y Message ID

4.5.18.2.

4.5.18.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpCmd

● Request body:

{
"id": 974,
"method": "EpCmd",
"system": {
"ver": "1.0",
"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"me": "2e97",

"cmd": "audio",

"cmdargs": "{\"adcmd\": \"play\", \"id\": 5, \"opt\": {\"vol\": 95, \"loop\": 2,


\"clear\": true}}"
}
}

● Signature original string:

method:EpCmd,agt:AGT_XXXXXXXX,cmd:audio,cmdargs:{"adcmd": "play", "id": 5, "opt":


{"vol": 95, "loop": 2, "clear":
true}},me:2e97,time:1447639497,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appke
y:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": "success"
}
The EpSet is generally used to control the attributes of a device. The attributes can be one

or more, but they lack flexibility. For some complex or special commands, EpCmd can be

used. It is generally used for compound commands and acts on a device. Special

processing can be performed on some commands, so the function is more powerful than

EpSet command. The current EpCmd commands are:

• The alarm plays voice commands;

• Outdoor camera sound and light alarm;

The specific Directives are as follows:

Directive Device Description

{ Smart Used to control the alarm sound play of Smart


cmd:"audio",
Station(MINI) Station (MINI).
cmdargs:{
adcmd: "play", cmd parameter must be filled in "audio";
id: 5,
Outdoor Camera cmdargs parameter is the serialized string of
opt: {
vol: 95, the JOSN object.
loop: 2,
Its contents are as follows:
clear: True,
led: True, • adcmd specifies the action Type, which
mute: False
has the following values:
}
Directive Device Description

} "play" : start sound playback

"stop" : stop sound playback


{
If to stop the sound playing, no other
cmd:"audio",
parameters are needed.
cmdargs:{
• id: indicates the serial number of the
adcmd: "stop",
sound to be played. There are currently 7
}
sound serial numbers, and the value range

is: [1,7].

• opt: an operation option. For the play

action Type, it has the following

attributes:

vol: Indicate the volume of the playback,

the value range is: [50,100], the larger the

value, the louder the sound.

loop: Indicates the number of times to

play.

clear: Indicate whether to clear the sound

being played and start the new sound

playback. If the value is false, the sound that

was originally played will be played together

with the new sound.


Directive Device Description

led: Whether to turn on the LED flashing

alarm of the outdoor camera.

mute: Whether it is mute or not, it is

generally used together

with LED. If you want to turn on the LED

blinking without sound alarm, you can set the

parameter is True.

Note:

The led and mute parameters are the

attributes only available to the Outdoor

Camera.
4.5.19.EpSetVar (Set Devices by Low-Level Command)

4.5.19.1.Request Specification

Type Definition Must Description

Interface EpSetVar Set Devices by Low-Level Command

Name

Partial URL api.EpSetVar

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

Request userid Y User ID


system
Content
appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.


time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpSetVar

agt Y Smart Station ID

me Y Device ID

idx Y Index, Integer Type

params
cmd Y Command number, Integer type

cmddata Y Command data, serialized string of JSON

array, JSON array member value is Byte

type

id Y Message ID

4.5.19.2.

4.5.19.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;


● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpSetVar

● Request body:

{
"id": 974,
"method": "EpSetVar",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"me": "2e97",

"idx": 129,

"cmd": 0,

"cmddata": "[0, 0, 0]"


}
}

● Signature original string:


method:EpSetVar,agt:AGT_XXXXXXXX,cmd:0,cmddata:[0, 0,
0],idx:129,me:2e97,time:1447639497,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,a
ppkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": "success"
}

The EpSetVar is a low-level command, which can complete some relatively low-level settings

for the device. Please strictly refer to the instructions described in the document for setting,

otherwise the setting will not succeed.

The current EpSetVar Directives are:

Directive Device Description

{ Smart Plug Used to clear the accumulated power

idx: 129, (Monitor consumption of the Smart Plug

cmd: 0, Energy

cmddata: [0, 0, 0] Usage) Note: After clearing, if you directly check the

} energy usage, the accumulated energy usage

will still exist. Clear will not take effect

immediately. You need to wait for the next


Directive Device Description

polling time, which will generally take a few

minutes.

Note:

The Directive command only lists the idx, cmd, and cmddata values. For the agt and me parameters,

please fill in the Smart Station Id and device Id of the specific device.

4.5.20.EpGetAttrs (Get Device extended attributes)

4.5.20.1.Request Specification

Type Definition Must Description


Interface EpGetAttrs Get Device extended attributes

Name

Partial URL api.EpGetAttrs

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

appkey Y appkey
system

did O (Optional) The unique id of the terminal. If it


Request
is filled in during authorization, the same id
Content
must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpGetAttrs

agt Y Smart Station ID


params
me Y Device ID
attrNames Y The attribute name array, which is the

serialized string of the JSON array

id Y Message ID

4.5.20.2.

4.5.20.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpGetAttrs

● Request body:

{
"id": 974,
"method": "EpGetAttrs",
"system": {
"ver": "1.0",
"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"me": "2e97",

"attrNames": "[\"PairCfg\"]"
}
}

● Signature original string:

method:EpGetAttrs,agt:AGT_XXXXXXXX,attrNames:["PairCfg"],me:2e97,time:144763949
7,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoke
n:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": {

"PairCfg": {

"warning_duration": 62

}
}
This interface can obtain the extended attributes of some devices. The currently supported

extended attributes are:

• PairCfg: RF device pairing configuration

When calling the EpAdd interface to add a code-matching device, you can set the

extended attributes of the device, for example, the duration of the alarm of Motion

Sensor. This interface can be used to obtain the corresponding value set when the

device is added.

Note:

Currently, only support CUBE Motion Sensor (SL_SC_BM), CUBE Environment Sensor (SL_SC_BE), and

Stellar Switch/Starry Switch/Polar Switch to obtain the PairCfg value. For details, please refer to the

introduction to the optarg parameter of the Add Device (EpAdd) interface.

4.5.21.EpTestRssi (Test RF Device Communication Quality)

4.5.21.1.Request Specification

Type Definition Must Description

Interface EpTestRssi Test RF Device Communication Quality

Name
Partial URL api.EpTestRssi

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID

appkey Y appkey
system

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id


Request
must be filled here.
Content

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpTestRssi

agt Y Smart Station ID

me N Device ID, if not fill in me, then it means


params
testing the RF signal strength of the Smart

Station
args N Extended attribute, is the serialized string

of JSON object, currently do not need to fill

in

id Y Message ID

4.5.21.2.

This interface obtains the signal strength of the RF device when test. It is only used for

debugging and maintenance of the on-site environment, not an interface under normal usage

scenarios.

4.5.21.3.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpTestRssi
● Request body:

{
"id": 974,
"method": "EpTestRssi",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"me": "2e97"
}
}

● Signature original string:

method:EpTestRssi,agt:AGT_XXXXXXXX,me:2e97,time:1447639497,userid:1111111,usertok
en:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXX
XX

● Response:

{
"id": 974,
"code": 0,
"message": {

"dbm": {

"back_noise_threshold": -99,
"back_noise": -114,

"recv": -19,

"send": -30

},

"rssi": {

"back_noise_threshold": 70,

"back_noise": 40,

"recv": 231,

"send": 208

}
}

Response Description:

dbm is decibel milliwatt. Its value is negative, and the closer to -0, the better the signal.

dbm.recv: RF signal strength in the receiving direction, Smart Station ==> device

dbm.send: RF signal strength in the sending direction, device ==> Smart Station

dbm.back_noise: background noise, the smaller the value (the farther from -0), the

smaller the background noise

dbm.back_noise_threshold: back noise threshold, when the value of back_noise is bigger

than the back noise threshold, it means that the site environment is bad and it has

affected the normal communication of the radio frequency device.

Rssi is the received signal strength indicator, and its value is a positive number. The

larger the value, the better the signal.

rssi.recv: RF signal strength in the receiving direction, Smart Station ==> device
rssi.send: RF signal strength in the sending direction, device ==> Smart Station

rssi.back_noise: background noise, the smaller the value, the smaller the background

noise

rssi.back_noise_threshold: back noise threshold, when the value of back_noise is bigger

than the back noise threshold, it means that the site environment is bad and it has

affected the normal communication of the radio frequency device.

Note:

When testing the signal strength of the Smart Station, that is, when there is no me attribute, the
returned attribute is {"back_noise", "back_noise_threshold", "signal"} . The signal attribute indicates
the current RF signal strength of the Smart Station. The larger the value, the better the radio
frequency signal of the Smart Station.
Do all RF devices support test?
Only RF devices that support command delivery, for example switches and plugs, support RF signal
test. For RF devices that actively report events, for example temperature and humidity sensors,
motion sensors, etc., they cannot be tested RF signal because there is no Command delivery
interface. To view their RF information, you can use the lHeart and lDbm attribute returned by
EpGetAll/EpGetCommand. The lDbm array returned by EpGetAll/EpGetCommand indicates the
dbm.send attribute on the device side, that is, the strength of the RF signal in the sending direction
of the device.

4.5.22.EpBatchSet (Set Multiple Device in Batch)

4.5.22.1.Request Specification

This interface is a batch operation interface, which is used to quickly set the attributes of

multiple devices. For example Turn on or turn off multiple switches/plugs/lights at once.
The interface will be optimized internally to reduce the time for the device to process the

command and ensure that the user has a good experience. And the interface supports three

different speed grade operations, which are applied to different scene requirements.

Type Definition Must Description

Interface EpBatchSet Set Multiple Device in Batch

Name

Partial URL api.EpBatchSet

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID
Request
system
appkey Y appkey
Content

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in


seconds.

method Y EpBatchSet

agt Y Smart Station ID

ioItems Y IO attribute collection, is the serialized

string of JSON array.

Each IO attribute is as follows:

"me":"2711",: identifies which device

"idx":"L1", :identifies the IO attributes of

the device

"type": 0x81,: attribute Type


params
"val": 1: the attribute value

speed N Speed level, currently supports three types,

respectively is:

• 0: normal

• 1: fast

• 2: extreme

The default is 0.

See the description below for details.


retry N Retry times, the default is twice.

It is valid only in the mode of speed is

normal and fast.

The number of retry attempts after

Command execution timeout due to radio

channel congestion. The value range is

[0,5]. This attribute is an advanced

attribute, please use it with caution.

checkIoSta N Check the IO status or not. 1 for check. It is

t valid only when the speed is normal or fast.

If the attribute value of the sub-device is

checked first, the command value is

ignored. If the attribute value is equal to the

delivered value, the command will be

ignored. It is an advanced attribute. And

should be used carefully.


uid N The unique identification code of command

for this time. The function of this parameter

is to identify the operation. If two

operations with the same uid attribute are

issued in a short period of time, the second

operation instruction will directly return an

EIGN error. This can prevent frequent

issuance of repeated instructions。

id Y Message ID

4.5.22.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpBatchSet
● Request body:

{
"id": 974,
"method": "EpBatchSet",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"ioItems": "[{\"me\": \"2f14\", \"idx\": \"L2\", \"type\": 129, \"val\": 1}, {\"me\":
\"2f14\", \"idx\": \"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"2f14\", \"idx\": \"L3\",
\"type\": 129, \"val\": 1}, {\"me\": \"2f13\", \"idx\": \"L1\", \"type\": 129, \"val\": 1},
{\"me\": \"2f0f\", \"idx\": \"L2\", \"type\": 129, \"val\": 1}, {\"me\": \"2f0f\", \"idx\":
\"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"2f0f\", \"idx\": \"L3\", \"type\": 129, \"val\":
1}, {\"me\": \"2f50\", \"idx\": \"L2\", \"type\": 129, \"val\": 1}, {\"me\": \"2f50\",
\"idx\": \"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"2f10\", \"idx\": \"L2\", \"type\": 129,
\"val\": 1}, {\"me\": \"2f10\", \"idx\": \"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"2f72\",
\"idx\": \"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"2f71\", \"idx\": \"L2\", \"type\": 129,
\"val\": 1}, {\"me\": \"2f71\", \"idx\": \"L1\", \"type\": 129, \"val\": 1}, {\"me\": \"8141\",
\"idx\": \"L\", \"type\": 129, \"val\": 1}]",

"speed": 1,

"uid": "TEST"

}
}
● Signature original string:

method:EpBatchSet,agt:AGT_XXXXXXXX,ioItems:[{"me": "2f14", "idx": "L2", "type": 129,


"val": 1}, {"me": "2f14", "idx": "L1", "type": 129, "val": 1}, {"me": "2f14", "idx": "L3", "type":
129, "val": 1}, {"me": "2f13", "idx": "L1", "type": 129, "val": 1}, {"me": "2f0f", "idx": "L2",
"type": 129, "val": 1}, {"me": "2f0f", "idx": "L1", "type": 129, "val": 1}, {"me": "2f0f", "idx":
"L3", "type": 129, "val": 1}, {"me": "2f50", "idx": "L2", "type": 129, "val": 1}, {"me": "2f50",
"idx": "L1", "type": 129, "val": 1}, {"me": "2f10", "idx": "L2", "type": 129, "val": 1}, {"me":
"2f10", "idx": "L1", "type": 129, "val": 1}, {"me": "2f72", "idx": "L1", "type": 129, "val": 1},
{"me": "2f71", "idx": "L2", "type": 129, "val": 1}, {"me": "2f71", "idx": "L1", "type": 129,
"val": 1}, {"me": "8141", "idx": "L", "type": 129, "val":
1}],speed:1,uid:TEST,time:1550748304,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,
appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,

"message": {

"failedIoItems": [

"me": "2f0f",

"idx": "L1",

"val": 1,

"type": 129,

"ret": 10013,

"retMsg": "ENR"

},

"me": "2f0f",

"idx": "L3",
"type": 129,

"val": 1,

"ret": 10013,

"retMsg": "ENR"

},
}

Response Description:

message.failedIoItems: indicates the list of Items that failed to execute. If all the items are

executed successfully, the property will be empty object.

If the current speed is in extreme mode, the failedIoItems property will not be returned.

4.5.22.4.Speed parameter description

Parameter Parameter Description

Value
Parameter Parameter Description

Value

0 normal(default)

The command is executed in the normal way, all command operations are

performed serially, and the feedback of the previous command needs to

be waited for before the next command is executed. Since the feedback

result of each command needs to be waited for, the time for the sub-

device to be executed is also long, and the device execution time on the

user's sensory experience is also long.

Feature:[Slow user experience, long interface execution time, and

accuracy]

1 fast

Execute one time quickly and do not wait the feedback. Then excute again

and wait for the feedback.

The first-time execution ensures that most of the sub-devices are quickly

executed, and the user will feel the execution is fast.

The second execution ensures that the failed command during the first

quick execution is executed again, ensuring the accuracy of the execution

results.

Since the execution of the two times is performed, the overall command

execution takes the longest time, but the first release is fast and the user

experience is better.
Parameter Parameter Description

Value

Feature:[Fast user experience, longest interface execution time,

guarantee accuracy]

2 extreme

Execute quickly for only one time and do not wait the feedback.

Since the sub-device is only executed once and quickly, the execution

time will be the shortest. However, in the case where there are many sub-

device lists, there is a possibility that some sub-devices fail to execute.

However, this method will still ensure that most of the child device

execution is successful, and the interface call takes the shortest time.

Feature:[Fast user experience, short interface execution time, no

guarantee of accuracy]
4.5.23.EpSearchIDev (Search for nearby IP network Device)

4.5.23.1.Request Specification

Type Definition Must Description

Interface EpSearchIDev Get the nearby IP network Devices Searched

Name By Smart Station.

When you need to add other Wi-Fi network

devices, for example IP cameras to Smart

Station, you need to execute this interface

first, and then call the EpAddIDev interface

to add the searched Wi-Fi network devices

to Smart Station.

Partial URL api.EpSearchIDev

Content Type application/json

HTTP Method POST

Request ver Y 1.0


system
Content lang Y en
sign Y Signature Value

userid Y User ID

appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpSearchIDev

agt Y Smart Station ID

mode Y Search mode, you can fill in: "notexist" or

"auto"

"notexist" means to return only the searched


params
nearby network devices that have not been

added to the Smart Station;

"auto" means to return all the nearby

network devices found;

id Y Message ID
4.5.23.2.

4.5.23.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpSearchIDev

● Request body:

{
"id": 974,
"method": "EpSearchIDev",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"mode": "notexist"
}
}

● Signature original string:

method:EpSearchIDev,agt:AGT_XXXXXXXX,mode:notexist,time:1447639497,userid:1111111,
usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_
XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":[{

"uuid": "4d756c74-694d-xxxx-xxxx-xxxxxxxxxxxx",

"devid": "4d756c74-694d-xxxx-xxxx-xxxxxxxxxxxx",

"devType": "iControl:iCamera2",

"name": "iCamera2",

"host": "192.168.1.222",

"port": 443,

"ttl": 0,

"auth": "Basic",

"defUser": "administrator",

"defPwd": "",

"exinfo": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><DeviceInfo


version=\"1.0\"><deviceName>iCamera2F97A2A</deviceName><deviceID>xxxxxxxx-
xxxx-xxxx-xxxx-
xxxxxxxxxxxx</deviceID><manufacturer>iControl</manufacturer><model>iCamera2</
model><serialNumber>1612AXN000294</serialNumber><macAddress>b4:a5:ef:f9:7a:2a
</macAddress><firmwareVersion>3.0.01.40</firmwareVersion><firmwareReleasedDate
>Jul
21,2016</firmwareReleasedDate><bootVersion>1.11</bootVersion><bootReleasedDate>
Jul
21,2016</bootReleasedDate><rescueVersion>3.0.01.40</rescueVersion><hardwareVersi
on>1</hardwareVersion><apiVersion>3.3</apiVersion></DeviceInfo>",

"dhcp": true

}]
}

Response Description:

* uuid: UUID of the searched network device;

* devType: Type of the searched network device;

* name: the name of the searched network device;

* host: the Host address of the searched network device;

* port: the host port number of the searched network device;

* ttl: The number of TTLs in the search process, which can be used to diagnose the

network;

* defUser: The default login account of the searched network device;

* defPwd: The default login account password of the searched network device;

* exinfo: The extended information of the searched network device;

Note:

1. Not all devices will contain exinfo information, this is related to the device type;
2. If the Smart Station has just been started or the IP device has just been joined to the local

network, the Smart Station may not obtain the extended information of the device in time. If the

exinfo information is not available at this time, you need to wait for a while and call the interface

again to obtain the search information;

3. For iCamera devices, if the password of the device has been changed and it is no longer the

initial password, we will not be able to obtain the extended information of the device because we

do not have permission. At this time, exinfo will be an error message;

4. In order to maintain compatibility, the interface does not parse the content of exinfo. The current

exinfo contains the complete information obtained by the query, and the user needs to parse the

information that needs attention from it;

5. For devices that do not support extended information, exinfo may be empty object or a string of

length is 0;

4.5.24.EpAddIDev (Add the nearby IP network Device)

4.5.24.1.Request Specification

Type Definition Must Description


Interface EpAddIDev To add the searched nearby IP network

Name devices to the Smart Station, you need to

perform the EpSearchIDev operation to

obtain the searched nearby network device

list before you can perform the adding

operation. For details, please refer to the

EpSearchIDev interface description.

Partial URL api.EpAddIDev

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User ID
Request
system
appkey Y appkey
Content

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.

time Y UTC timestamp, since January 1, 1970, in


seconds.

method Y EpAddIDev

agt Y Smart Station ID

uuid Y UUID of the network device that want to

add, obtained from network device info

returned by EpSearchIDev.

devType Y Device type of the network device that want

to add, obtained from network device info

returned by EpSearchIDev.

host Y Host of the network device that want to

add, obtained from network device info

returned by EpSearchIDev.

params
port Y Port of the network device that want to add,

obtained from network device info returned

by EpSearchIDev.

name Y Name of the network device that want to

add, can be named by ourselves, not

necessarily to be equal to network device

name returned by EpSearchIDev.


user O Login account of the network device that

want to add, if the user has modified the

login account, then here must fill in the

modified login account, otherwise the Smart

Station cannot connect network device

properly. If the user has not modified the

login account, then fill in the default login

account (defUser) according to return info

of EpSearchIDev, if discover interface does

not return default login account, then it can

be left void.

pwd O Login password of the network device that

want to add, if the user has modified the

login password, then here must fill in the

modified login password, otherwise the

Smart Station cannot connect network

device properly. If the user has not modified

the login password, then fill in the default

login password (defPwd) according to return

info of EpSearchIDev, if discover interface

does not return default login password, then

it can be left void.


id Y Message ID

4.5.24.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpAddIDev

● Request body:

{
"id": 974,
"method": "EpAddIDev",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"uuid": "4d756c74-694d-xxxx-xxxx-xxxxxxxxxxxx",

"devType": "iControl:iCamera2",

"host": "192.168.1.222",

"port": 443,

"name": "iCamera2BB",

"user": "administrator",

"pwd": ""
}
}

● Signature original string:

method:EpAddIDev,agt:AGT_XXXXXXXX,devType:iControl:iCamera2,host:192.168.1.222,n
ame:iCamera2BB,port:443,pwd:,user:administrator,uuid:4d756c74-694d-xxxx-xxxx-
xxxxxxxxxxxx,time:1447639497,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:
APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":"2d3a"
}

Response Description:
If it is executed successfully, message attribute indicates "me" attribute value of the new

smart device that has been added to the Smart Station.

If the device is already in the Smart Station, i.e. added to the Smart Station before, then

messagewill still return "me" attribute value of the device in Smart Station.
4.5.25.EpMaintOtaFiles (Maintain the OTA FileList)

4.5.25.1.Request Specification

Type Definition Must Description

Interface EpMaintOtaFiles View or maintain the list of OTA files on the

Name Smart Station that can be used to upgrade

the firmware version of the sub-device

Partial URL api.EpMaintOtaFiles

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

Request userid Y User ID


system
Content
appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.


time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpMaintOtaFiles

agt Y Smart Station ID

act Y Operation instruction, type is string,

currently can be as follows:

• AddByUrl: Inform the URL address and

download the OTA file to the Smart

Station;

• AddByBin: Provide the raw data of OTA

files directly to the smart center;

params • Query: Query OTA file information;

• Remove: Delete OTA file;

• QueryAvailableEps:Query the list of sub

devices that can be upgraded using this

OTA file
actargs O Operation command parameters, the data is

a serialized string of JSON object.

Operation command parameters correspond

with operation commands, definition is as

following:

• AddByUrl: {key, url},url indicates the

address of the OTA file that can be

downloaded, url must be HTTP or HTTPS

protocol; key is the optional parameter, if

key is not provided then the key is the file

name in the url downloading address,

Please use the key parameter carefully,

the naming of the key must be correct,

otherwise the upgrade may fail, if it is not

necessary there is no need to set key, just

use the void name.

• AddByBin: {key, cont},key indicates the

flag of the OTA file, being different to

AddByUrl, key must be provided here and

cannot be void, cont indicates the content

of the OTA file, for convenient trasmission

in JSON, cont is the standard Base64


coding of the original OTA file;

• Query: actargs is not necessrily to be

provided;

• Remove: {key},key indicates the OTA

file that needs to be removed, if

key=true then remove all OTA files in

this Smart Station, if key=["key1",

"key2"] then remove the OTA file set in

batch that the array indicates, if

key="key1" then remove the specific

OTA file;

• QueryAvailableEps:{keys}, keys indicates

the list of OTA files to query. Its value is

a string array, indicating the list of OTA

files to query. If keys are not specified,

it indicates querying all OTA files under

the smart station.

id Y Message ID

4.5.25.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;


apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpMaintOtaFiles

● Request body:

{
"id": 974,
"method": "EpMaintOtaFiles",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"act": "AddByUrl",

"actargs": "{\"url\":
\"http://www.ilifesmart.com/upgrade/test/FL01_030xxd10_00000631.ota\"}"

}
}
● Signature original string:

method:EpMaintOtaFiles,act:AddByUrl,actargs:{"url":
"http://www.ilifesmart.com/upgrade/test/FL01_030xxd10_00000631.ota"},agt:AGT_XXX
XXXXX,time:1447639497,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appkey:APPK
EY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":"success"
}

Note:

If it is the enquiry command, then the OTA file list returned is as following:

{
"code": 0,
"message":
[
{
"key": "FL01_ZG10370104_00000002.ota", // mark the OTA file
"size": 165868 // indicates the size of the OTA file
},...
]
Note:
If QueryAvailableEps is used, the returned OTA file list is as follows:
{
"code": 0,
"message": {
"FL01_03580000_00000605. ota": [//Identify the OTA file
{
"me": "a0db",
"ver": "0.1.6.5",
"devtype": "SL_LI_WW",
"fullCls": "SL_LI_WW_V3",
"name": "Dimming LED Driver",
"OtaVer": "6.5",//The OTA file version number
"EpVer": "6.4",//The current version number of the sub device
"SupportOta": true,//Whether the sub device supports OTA upgrade
"NeedOta": true,//Whether the sub device needs to upgrade OTA
"lsid": "A1gAACfu0f7_hDwA_____w",
"rfic": 3
}
],
...
}
}
4.5.26.EpMaintOtaTasks (Maintain The OTA Task)

4.5.26.1.Request Specification

Type Definition Must Description

Interface EpMaintOtaTasks View or maintain the task list of the current

Name sub-devices on the Smart Station that is

performing OTA upgrade.

Partial URL api.EpMaintOtaTasks

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

Request userid Y User ID


system
Content
appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.


time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpMaintOtaTasks

agt Y Smart Station ID

act Y Operation command, type is string, currently

it can be as following:

• Query: enquiry OTA task info

• Remove: remove OTA tasks that has

finished

actargs O Operation command parameter, the data is

a serialized string of JSON object.

Operation command parameters correspond

with operation commands, definition is as

following:
params

• Query: actargs is not necessarily to be

provided;

• Remove: {key},key indicates the OTA

task that needs to be removed, if key=true

then remove all finished OTA task in the

Smart Station, if key=["key1", "key2"] then

remove finished OTA task set in batch that


the array indicates, if key="key1" then

remove specific OTA task that is finished;

Note: it can only delete OTA task that has

completed

• Add: {me, key}, me indicates the sub

device to be upgraded, and key indicates

the upgrade OTA file. Note: The type of

the sub device must be consistent with the

OTA file, otherwise it cannot be upgraded.

You can call the QueryAvailableEps

command of the EpMaintOtaFiles interface

to query the list of sub devices supported

by the OTA file.

id Y Message ID

4.5.26.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;


agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpMaintOtaTasks

● Request body:

{
"id": 974,
"method": "EpMaintOtaTasks",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"act": "Query"

}
}

● Signature original string:

method:EpMaintOtaTasks,act:Query,agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,
usertoken:USERTOKEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_
XXXXXXXX
● Response:

{
"id": 974,
"code": 0,
"message":{

"ZGB752": {

"id": "ZGB752",

"cur": 14158,

"size": 165566,

"file": "FL01_ZG10370104_00000002.ota",

"tover": "\u0000\u0000\u0000\u0002",

"sts": 1577443530,

"ts": 1577444053

},...

}
}

Response Description:

id: Indicates the id of the ZigBee device, and its value is equal to "ZG" + the hexadecimal

representation of zg_nodeid;

cur: Indicates the progress of the current OTA upgrade task, if cur is equal to size, it

indicates that the upgrade has been completed;

size: The total size of the current OTA file;

file: The file name of the current OTA file, which is also the key;

tover: The firmware version number of the current OTA file;

sts: The start time of the current upgrade task, in UTC time, in seconds;
ts: The latest feedback time of the current upgrade task is UTC time in seconds;
4.5.27.EpMaintAgtRM (Backup or Restore The Smart Station)

4.5.27.1.Request Specification

Type Definition Must Description

Interface EpMaintAgtRM Backup or restore configurations on Smart

Name Station, including all configuration data of

sub devices and AI.

Partial URL api.EpMaintAgtRM

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

Request userid Y User ID


system
Content
appkey Y appkey

did O (Optional) The unique id of the terminal. If it

is filled in during authorization, the same id

must be filled here.


time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpMaintAgtRM

agt Y Smart Station ID

act Y Operation commands, type is string,

currently it can be as following:

• backup: backup Smart Station

configurations

params • restore: restore Smart Station

configurations
actargs Y Operation command parameter, the data is

a serialized string of JSON object.

Operation command parameters correspond

with operation commands, definition is as

following:

• backup: {nids, pwd}, nids indicates the

module that needs to backup, if the

module is not indicated then void backup

data of all modules in the Smart Station, if

the module is indicated then the data type

is string array, in normal cases there is no

need to fill in this field. pwd indicates the

encryption password, next time when

executing recovery the same password

must be provided, otherwise it cannot be

used for restore, if it is left void then no

password;

• restore: {cont, pwd, neednids},cont

indicates the original backup data that can

be used for recovery. Pwd indicates the

recovery password, i.e the password that

backup command indicates, if backup


operation indicates the password, then

restore operation should provide the same

password.neednids indicates it is used to

recover a part of the data, it indicates the

module data that needs to be recovered,

normally no need to provide this attribute.


id Y Message ID

4.5.27.2.Example - Backup

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpMaintAgtRM

● Request body:

{
"id": 974,
"method": "EpMaintAgtRM",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"act": "backup",

"actargs": "{\"pwd\": \"ls0000\"}"

}
}

● Signature original string:

method:EpMaintAgtRM,act:backup,actargs:{"pwd":
"ls0000"},agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USERTOKEN_X
XXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message":"Q2NfTiRXQB5PLjxfXzlVQ10XLjhPeioiIiA9SBJDUG1......"
}

Response Description:

message: It is the original data of the returned backup, which is encrypted and cannot be

read.

Note:
The backup operation obtains data directly from the Smart Station, so the Smart Station must be

online. If the Smart Station is not online, the backup operation cannot be completed.

4.5.27.3.Example - Restore

● Request body:

{
"id": 974,
"method": "EpMaintAgtRM",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"act": "restore",

"actargs": "{\"cont\": \"Q2NfTiRXQB5PLjxfXzlVQ10XLjhPeioiIiA9SBJDUG1......\",


\"pwd\": \"ls0000\"}"

}
}

● Signature original string:

method:EpMaintAgtRM,act:restore,actargs:{"cont":
"Q2NfTiRXQB5PLjxfXzlVQ10XLjhPeioiIiA9SBJDUG1......","pwd":
"ls0000"},agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USERTOKEN_X
XXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 974,
"code": 0,
"message": {

"rets": {

"cfg/rf3": true,

"cfg/rf6": true,

"me": true,

"zigbee": true,

"cfg/rf5": true

}
}

Response Description:

message: The rets object indicates the result of the module recovery.

Note:

After successfully executing the recovery data, you must call the api.EpRebootAgt interface to restart

the smart center to take effect.


4.5.28.EpMaintCartFiles(View or maintain the list of Cart files

on the smart station)

4.5.28.1.Request Specification

Type Definition Must Description

Interface EpMaintCartFiles View or maintain the list of Cart files on the


Name
smart station

Partial URL api.EpMaintCartFiles

Content Type application/json


HTTP Method POST
ver Y 1.0
lang Y en
sign Y Sign value

userid Y User ID
appkey Y appkey
system
did O (Optional) The unique id of the
Request terminal. If it is filled in
Content during authorization, the same id
must be filled here

time Y UTC timestamp, since January 1,


1970, in seconds

method Y EpMaintCartFiles
agt Y Smart Station ID
act Y Operation instructions, of type string, can
currently be as follows:
params • AddByUrl: Notify the URL address and
download the Cart file to the smart station;
• AddByBin: Directly provide the raw data of
Cart files to the smart station;
• Query: Query Cart file information
• Remove: Delete Cart file

actargs O The operation instruction parameter, whose


data is a serialized string of JSON objects. The
operation instruction parameters correspond to
the operation instruction one by one, and are
defined as follows:
• AddByUrl: {key, URL}, the URL parameter
indicates the address of the cart file that can
be downloaded, and the URL must be HTTP
or HTTPS protocol; Key is an optional
parameter. If no key is provided, the key is
the file name in the download address
provided by the URL. Please use the key
parameter with cautio n. The name of the
key parameter must be correct, otherwise
the upgrade may fail. If it is not necessary,
there is no need to set the key parameter,
and the default name can be used.
• AddByBin: {key, cont}, key indicates the
identifier of the cart file. Unlike AddByUrl,
where key must be provided and cannot be
empty, cont indicates the content of the cart
file. For ease of transmission in JSON, cont
is the standard Base64 encoding of the
original cart file;
• Query: actargs can be provided without any
need;
• Remove: {keys}, keys indicate the Cart files
that need to be removed. If keys=true, it
indicates the deletion of all Cart files under
the smart center. If keys=["key1", "key2"], it
indicates the batch deletion of the Cart file
set specified in the array. If keys="key1", it
indicates the deletion of specific Cart files;

id Y Message id

4.5.28.2.Request Specification

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;


● URL:

svrurl+PartialURL, for example:

https://api.ilifesmart.com/app/api.EpMaintCartFiles
● Requets Body:

{
"id": 974,
"method": "EpMaintCartFiles",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",
"act": "AddByUrl",
"actargs": "{\"url\":
\"https://x.cololight.com/mweb/attach/upload/coloxxtemp/kt6_9AB807.r
om\"}"
}
}

● Signature original string:

method:EpMaintCartFiles,act:AddByUrl,actargs:{"url":
"https://x.cololight.com/mweb/attach/upload/coloxxtemp/kt6_9AB807.ro
m"},agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USERTO
KEN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX
● Response:

{
"id": 974,
"code": 0,
"message":"success"
}

Reminder:
If it is a query command, the list of Cart files returned is as follows:
{
"code": 0,
"message": {
"MAXFILELEN": 1048576, Indicates the maximum size allowed for a single Cart file, in bytese
"MAXSTORESIZE": 5242880, Indicates the maximum capacity of the entire disk space, in bytes
"files": [
{
"key": "kt6_9AB807.rom", // Identify the Cart file
"size": 55462 // Indicate the size of the Cart file
},...
]
}
}

4.5.29.EpConfigAgt (Set Smart Station Configuration)

4.5.29.1.Request Specification

Type Definition Mu Description

st

Interface EpConfigAgt • Set Smart Station configurations, including


whether allow local login, modify local
Name
password etc.

Partial URL api.EpConfigAgt

Content Type application/json

HTTP Method POST

ver Y 1.0

lang Y en

Request
system sign Y Signature Value
Content

userid Y User ID

appkey Y appkey
did O (Optional) The unique id of the terminal. If it is

filled in during authorization, the same id must

be filled here.

time Y UTC timestamp, since January 1, 1970, in

seconds.

method Y EpConfigAgt

agt Y Smart Station ID

act Y Operation command,type is string, currently

canbe as following:

• queryLocalPermission: query whether allow

local login

• setLocalPermission: set whether allow local

login

• setLocalPwd: set local login account and

password

params • queryTimezone: query Smart Station time

zone

• setTimezone: set Smart Station time zone

• queryLoc: query Smart Station geographycal

location

• setLoc: set Smart Station geographycal


location

• querySys: query Smart Station MAC, IP info

• queryExSvs: query Smart Station extended

service

• setExSv: set Smart Station extended service

• netInfo: query network information


actargs O Command parameter, the data is a serialized

string of JSON object. Operation command

parameters correspond with operation

commands;

Definition is as following:

• queryLocalPermission:{}, no need to provide

parameters, it can be null or empty object;

• setLocalPermission:{stat}, stat indicates

whether allow local login, when stat is

"locked" means forbid local login, stat is

"normal" means allow local login;

• setLocalPwd:{pwd}, pwd indicates passwotd

for locally login admin account, default

password for local login is admin, it can be

modified. Note: pwd needs to use standard

Base64 coding, e.g assuming the password

is set to “ hello ” , then pwd should be

"aGVsbG8=", there is no limit for password

length, the password is stored in the Smart

Station in an irreversible way;

• queryTimezone:{}, no need to provide


parameters, it can be null or empty object;

• setTimezone:{tmzone}, tmzone indicated the

time zone to set, time zone type is integer,

range: [-11, 12];

• queryLoc:{}, no need to provide parameters,

it can be null or void object;

• setLoc:{lnglat,fullSync}, lnglat indicates the

geographical location to set, type is string,

format is "lng,lat", e.g:

"120.15507,30.274084" is the longitude and

latitude of Hangzhou; fullSync=1 represents

full content synchronization, because

besides store lnglat, Loc can also store

other geographical location info, if fullSync=1

then other key values that are not included in

parameters will be deleted, by default

fullSync=0;

• querySys:{}, no need to provide parameters,

it can be null or void object;

• queryExSvs:{verbose=1/0}, enquiry extended

service, verbose=1 means it will return

detailed info of every service, otherwise it


will only return whether the service exists

and in enabled status, default verbose=0;

• setExSv:{svId,args={},reload=1/0}, configure

extended service. svcId indicates extended

service id, args indicates extended service

parameters, reload indicates whether need

reload to make it work immediately after the

exteded service is changed, reload=1 means

it needs reload and work immediately. Refer

to 2.5.28.3 for more details.


id Y Message ID

4.5.29.2.act and actargs parameter list

Function act actarg Response

{stat,policy}: 1.stat:
indicate a specific state.
If stat="locked" indicates
that local login is
prohibited; If stat=
"normal" means that local
Query
login is allowed;
whether to
queryLocalPermi No need to carry this parameter, or 2.policy indicates local
allow local
ssion null Json Object (actarg:{}) account policy. If
login
policy="[nolsi]" indicates
configuration
that the local Internet
must provide the correct
account/password,
otherwise the login is not
allowed. Default "" ,means
allowed.
{stat, policy}
1.stat: indicate a specific state. If
stat="locked" indicates that local
Set whether login is prohibited; If stat=
setLocalPermissi
to allow local "normal" means that local login is "success"
on
login allowed;
2.policy indicates local account
policy. If policy="[nolsi]" indicates
that the local Internet must provide
Function act actarg Response

the correct account/password,


otherwise the login is not allowed.
Default "" ,means allowed.

{pwd}: the password of login local


smart device,the default password
of admin account is admin,can be
changed to required password.
Note:Standard Base64 encoding
needs to be used. For example, if
Set the
the password is set to "hello", the
password of
setLocalPwd parameter pwd should be "success"
login local
"aGVsbG8=", the password length
mode
is not limited, and the password is
an irreversible encryption method
stored on the Smart Station.
The set password does not allow
query, so queryLocalPwd is not
exist.
Query {tmzone}, tmzone
No need to carry this parameter, or
timezone of queryTimezone indicates the currently
null Json Object{}
Smart Station timezone
{tmzone}, tmzone indicates the
Set timezone
time zone that needs to be set, the
of Smart setTimezone "success"
time zone type is an integer, the
Station
value range: [-11,12]
Function act actarg Response

{lnglat}:Returns the
Query the
No need to carry this parameter, or currently set address
location of queryLoc
null Json Object{} location as a string in the
Smart Station
format "lng,lat"
{lnglat,fullSync}
1.Lnglat: indicate the geographic
location that needs to be set, the
type is a string, and the format is
"lng,lat".
For example,
"120.15507,30.274084" is the
Set the latitude and longitude of
location of setLoc Hangzhou; "success"
Smart Station 2.fullSync: Because Loc can
actually store other geographic
location information in addition to
storing lnglat. If
fullSync=1,indicates sync all info. If
you add user-defined key in Loc,
fullSync=1 will delect your user-
defined keys; Default fullSync=0;
Query Mac {mac, ip}:
No need to carry this parameter, or
and Ip of querySys 1.mac, mac address
null Json Object{}
Smart Station 2.ip,IP address

{verbose=1/0}: Query Extended {${exSvc}: {...},},Returns


Service the current configuration
Query
If verbose=1,indicates that the and status of the
Extended
queryExSvs detailed information of each extension service. For
Service of
service will be returned; example, the weather
Smart Station
If verbose=0,it will only return forecast extension service
whether the service exists and is configuration:{
Function act actarg Response

enabled,default verbose=0; "weather": {


"state": "OK",
"appkey": "XXX",
"url": "YYY"
}
}

{svId,args={},reload=1/0}: Set
Extended Service.
1.svcId:indicates Extended Service
Id
2.args:indicates the configuration

Set Extended parameters of Extended Service

Service of setExSv 3.reload: Indicates whether the "success"


Smart Station extension service configuration
need be reloaded to take effect
immediately or not after changes.
reload=1, means need be reloaded
to take effect immediately. Details

please refer to 4.5.28.4


Return network info,
example:{
"gateway": [
"? (192.168.4.1) at
Query
24:fb:65:60:e3:03 [ether]
network info No need to carry this parameter, or
netInfo on eth0\n"
of Smart null Json Object{}
]
Station
}
gateway is an array, the
entries in it are the
gateway information
Function act actarg Response

returned by the ARP


protocol, and the gateway
MAC address can be
resolved by itself based
on the ARP protocol.

{${ifn}: {....}}, returns the


current configuration of
{ifn,verbose=1/0}: Query network
the query ifn, for example:
module
{
configuration.verbose=1means
"wlan0": {
return the detail info, default
"enable": true,
verbose=0.
"metric": 100,
The current ifn value is optional as
Query "C_NetworkType":
follows:
network "AP",
• "eth0": ethernet
module "mode": "rtl8821cs",
queryNifCfg • "eth1": HUAWEI 4G
configuration "C_SSID": "cn2",
Wifi USB-dongle
of Smart "C_WPAPSK":
• "ppp0": 2G module
Station "12345678",
• "wlan0": Wi-Fi
"C_HWMode": "5G",
• "usbeth0": USB
"C_EncrypType": "hh",
dongle
"C_AuthMode":
• "wwan0": WWAN-4G
"OPEN",
module 4G-CAT4
"name": "wlan0"
• "usb0": 4G-CAT1
}
}
Function act actarg Response

{ifn,enable=true/false}:
enable=true,means Enable,
enable=false,means disable,
The current ifn value is optional as
follows:
Set network • "eth0": ethernet
module • "eth1": HUAWEI 4G
configuration setNifCfg Wifi USB-dongle "success"
of Smart • "ppp0": 2G module
Station • "wlan0": Wi-Fi
• "usbeth0": USB
dongle
• "wwan0": WWAN-4G
module 4G-CAT4
• "usb0": 4G-CAT1
Return list of currently set
whitelists
[{lsid,user,pwd,addr},...]

Query the
• Lsid: LSID
local
No need to carry this parameter, or of smart device(=agt
interconnect
null Json Object{} attribute of smart
whitelist of queryLsiWhitelist
device)
Smart Station
Details please refer to 4.5.28.5 • User: local
in local
mode account ID of
network
smart device
• Pwd: login
account ID of smart
device
[
['-','lsid'],
['-','*'],
['+',lsid,user,pwd]
]
Set a whitelist, support multiple
items to be set together.
Each entry is a JSONArray,
• The first item of the entry is "+"
or "-", "+" indicates adding a
whitelist, "-" indicates deleting a
whitelist;
• The second item of the entry is [{ret,retMsg},...]
Set the local the lsid of the smart device. If the Returns whether each
interconnect operation is to delete the whitelist, setting of the setting list
whitelist of the value of the second item is "*" item is successful.
setLsiWhitelist
Smart Station to delete all the whitelists; If successful, ret=0;
in local • The third item of the entry is the If failed, ret≠0, and
network login account of the smart device, retMsg indicates specific
which needs to be filled only when error information;
adding a whitelist;
• The forth item of the entry is the
local mode login password of the
smart device, which needs to be
filled only when adding a whitelist;

Tip: The update modification


operation is the same as adding
operation parameters. If the
whitelist of the lsid already exists,
the user and pwd settings of the
lsid will be overwritten.
{policy}:
policy= whitelist or
policy={ }。
“whitelist” Indicates that
Query the when the smart center
searching No need to carry this parameter, or LAN searches for smart
policy of queryLsiPolicy null Json Object{} devices, it only sends
local search packets to the
interconnect whitelisted devices,
otherwise the Smart
Station will send
multicast/broadcast
packets
Set the
searching
policy of setLsiPolicy {policy: 'whitelist' or '' } "success"
local
interconnect
No need to carry this parameter, or
Reset RF
resetRfModule null Json Object{} "success"
module

4.5.29.3.Example - setLocalPermission

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

agt is AGT_XXXXXXXX, need to fill in real data;


● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/api.EpConfigAgt

● Request body:

{
"id": 974,
"method": "EpConfigAgt",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "1111111",

"appkey": "APPKEY_XXXXXXXX",
"time": 1447639497,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"agt": "AGT_XXXXXXXX",

"act": "setLocalPermission",

"actargs": "{\"stat\": \"locked\"}"

}
}

● Signature original string:

method:EpConfigAgt,act:setLocalPermission,actargs:{"stat":
"locked"},agt:AGT_XXXXXXXX,time:1447639497,userid:1111111,usertoken:USERTOKEN_X
XXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX
● Response:

{
"id": 974,
"code": 0,
"message":"success"
}

Note:

Local login refers to the use of LifeSmart App to search for a smart center in the local area network,

and then log in to the smart center locally to control operations.

queryLocalPermission: If successful, the returned information is as follows: {"code":0, "message":

{"stat": "locked"/"normal"}}, locked indicates that local login is prohibited, and normal indicates that

local login is allowed.

setLocalPwd: If successful, the returned information is as follows: {"code":0, "message":"success"}.

The set password is not allowed to be queried. The password is stored in the smart center with

irreversible encryption, so there is no queryLocalPwd action.

netInfo: If successful, the return information is as follows: {"code": 0, "message": {"gateway": ["?

(192.168.4.1) at 24:fb:65:60:e3:03 [ether] on eth0\ n"]}}, gateway is an array, the entries inside are the

gateway information returned by the ARP protocol, and the MAC address of the gateway can be

resolved by itself based on the ARP protocol.


4.5.29.4.ExSv extended service

• Weather service

svId: "weather",

args: {

"enable" : True/False whether enable the service

"svt": "style1" service type, here just fill in "style1"

"url": {WEATHER_SERVICE_URL} weather service URL

"appkey": {APPKEY} AppKey allocated for weather service

"apptoken" {APPTOKEN} AppToken allocated for weather service

},

"reload": 1/0 whether to reload and make it work immediately

• MDNS Search service

svId: "lc_mdns",
args: {
"enable" : True/False ,indicates enable or not
},
"reload": 1/0 indicates reload to make effect

Action Definition - Add MAC Address


act: "AddOne"
actargs: {...}
mac: String, MAC address
Example: {"act":"AddOne","actargs":{"mac":"70886B14673D"}}

• AI
Rule of objectID:"AGT_ID/me/ai/AI_ID"
If you need to configure scene A under a Samrt Station in the same network:

If scene info is:

agt="A3EAxxxxxxxxxxxxxxxx",me="4802",ai="AI_OI_1646821884"
Then the odjectID should be configured as:

"A3EAxxxxxxxxxxxxxxxx/me/ai/AI_OI_1646821884"

5.Device Attributes Specifications

The OpenAPI interface is divided into two categories: query device and control device ;

When called to query interface to smart device, returned data information contains some

common attribute which used to describe the smart device, see: Form 5-1-1. In addition ,the

different smart device contains its special attributes, please refer to the document:

"LifeSmart Attribution of Smart Device"

Attribute Type RW Decription

devtype/cls string R Type of smart device

name string RW Device name

agt string R Station ID

me string R device ID

Online status

stat int32 R 0:offline

1:online

data array R The IO message of device


Form 5-1-1 General attribute description

When calling the control interface of a smart device, please refer to the document:

"LifeSmart Attribution of Smart Device" corresponding to the property description of the

device specification that needs to be controlled to set the control parameters.

It should be noted that some of the properties are not performed for OpenAPI Open, and only

the attributes marked as RW have the setting function.

6.Discovery Protocol

The discovery protocol defines a method for discovering smart devices such as Smart Station

in a local area network.

Protocol UDP

Port Number 12345

Message Type Broadcast message

Message Content Z-SEARCH * \r\n


Response MOD= xxxx\nSN=xxxx\nNAME=xxxx\n

or

MGAMOD=xxxxx\nLSID=xxxxx\nNAME=xxxxx\n

Where xxxx is the corresponding setting value of the smart device.

New versions of smart devices may also add new attributes, which will

be divided by ‘\n’. If they are not recognized, they can be ignored.

• "MGAMOD" or "MOD" indicates device type;

• "SN" or "LSID" indicates device serial number;

• "NAME" indicates the name of the smart device

7.WebSocket Event

The Application can pay attention to the change event of the device state.

The LifeSmart OpenAPI service provides access via WebSocket, and pays attention to the

status change events of the device.

Note:

●After connected successfully, the connection of WebSocket will keep alive, you can send

WbAuth or RmAuth request on the connection.

●WbAuth: WebSocket authentication, authenticate one user at a time, can authenticate

multiple times in one connection, achieve the effect of single connection and multiple

users, and can continue to authenticate;


●RmAuth: WebSocket authentication is removed. One user is removed at a time. When the

number of users reaches zero, the connection is automatically disconnected;

7.1.Flow

7.2.URL

According to the service area where different user accounts (LifeSmart accounts) are located,

the WebSocket service needs to use the corresponding service address. svrrgnid is the

service partition mark, and the corresponding svrrgnid information will be returned after the

user authorization is successful. Use the following corresponding WebSocket URL according

to different svrrgnid:

Service Type svrrgnid URL


GS wss://api.ilifesmart.com:8443/wsapp/

VIP1 wss://api.cn1.ilifesmart.com:8443/wsapp/

CN2 wss://api.cn2.ilifesmart.com:8443/wsapp/

WebSocket with SSL AME wss://api.us.ilifesmart.com:8443/wsapp/

EUROPE wss://api.eur.ilifesmart.com/wsapp/

JAP wss://api.jp.ilifesmart.com:8443/wsapp/

APZ wss://api.apz.ilifesmart.com:8443/wsapp/

7.3.WebSocket Authorization

After the WebSocket is correctly connected, please send the authentication message as soon

as possible, otherwise the connection will be interrupted.

The svrrgnid of the authentication LifeSmart account must be consistent with the svrrgnid of

the WebSocket URL, otherwise the authentication will fail.

7.3.1.Request Specification

Type Definition Must Description

Interface Name WbAuth WebSocket authentication

Content Type application/json


ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User id

appkey Y appkey
system
did O (Optional) The unique id of the
Request Content
terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1,

1970, in seconds.

method Y WbAuth

id Y Message ID

7.3.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;


sign is SIGN_XXXXXXXX, need to fill in real sign data;

● Request body:

{
"id": 957,
"method": "WbAuth",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}

● Signature original string:

method:WbAuth,time:1447641115,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appke
y:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

{
"id": 957,
"code": 0,
"message": "success"
}
7.4.WebSocket Remove Authentication

7.4.1.Request Specification

Type Definition Must Description

Interface Name RmAuth WebSocket Remove Authenticated User

Content Type application/json

ver Y 1.0

lang Y en

sign Y Signature Value

userid Y User id

appkey Y appkey

system
did O (Optional) The unique id of the
Request Content

terminal. If it is filled in during

authorization, the same id must be

filled here.

time Y UTC timestamp, since January 1, 1970,

in seconds.

method Y RmAuth
id Y Message ID

7.4.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● Request body:

{
"id": 957,
"method": "RmAuth",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}

● Signature original string:

method:RmAuth,time:1447641115,userid:1111111,usertoken:USERTOKEN_XXXXXXXX,appke
y:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX
● Response:

{
"id": 957,
"code": 0,
"message": "success"
}

7.5.Event Format

All event data is JSON encoded, and its format is as follows:

id Message ID

type Event type. type=‘io’ means IO status data refresh

msg Event body. Different parses according to different event types.

7.6.Event Specification

Event content attributes are:

Field Type Description

userid string User ID

agt string Smart Station ID


Device ID

me string When it is Smart Station level event then its value does not exist;

When it is AI event then its value represents AI id;

Device IO indication. Contents are different according to

different device types. It corresponds with device attributes, e.g.

T, O etc.

idx="s" is a special type, needs to check other attributes for

further judgement.
idx string

If there is info field then it needs to do further process referring

to info, e.g. device add, device delete, device name modification,

AI add/delete/change etc. special event; otherwise it is

device/Smart Station online/offline.

Device type

When it is Smart Station event then the value is fixed to be "agt";

When it is AI event then the value is fixed to be "ai";


devtype string
Note: When devtype is equal to "elog", it is a special event, and

the specific content needs to refer to the elog attribute in the

event body (the attribute value is the object type).

fullCls string Full device type which includes device version


Device IO value type, the meaning of it is the same with device

type int32 attributes, when idx="s" mark special events, the value of it is

invalid.

Device IO value, the meaning of it is the same with device

val int32 attributes, when idx="s" mark special events, the value of it is

invalid.

True valid value, in the circumstance of idx!="s", the value of it is

the true valid value of val, e.g. the temperature change event,

val=230, v=23.0, representing temperature value is 23.0°C, in the

v float circumstance of idx="s", the value of it is a fixed value, details

are as following:

Device online, the value=1;

Device offline, the value=2.

UTC time of the event occurrence, millisecons calculated from


ts int64
1/1/1970
Event extended service, the values are: "add", "del", "name",

"ioname", "full", "chg" etc.

add: adding events of which flags are device/Smart Station/AI;

del: deleting events of which flags are device/Smart Station/A;

info string name: event of which flag is device name modification;

ioname: event of which flag is device IO name modification;

full: event of which flag is Smart Station full content

syncronization;

chg: modificaiton event of which flag is AI, including name,

status,configuraiton;

Only valid for name modification events, including device

name/device IO name/AI name modification events, i.e


name string
info="name" or info="ioname" or info="chg". It is for indicating

the new name.

Only valid for device IO name modification event, i.e

io string info="ioname". It is for indicating which IO name of the device

has been modified.

Only valid for AI events, indicating AI status has been changed.

stat int32 stat=0 representing the AI is in initial status;

stat=3 representing the AI is running;


stat=4 representing the AI has completed running;

Only valid for AI events, if it True means the AI configuration has


cmdlist bool
been changed.

Security event content, the specific attributes are defined as

follows:

lvl: int32, Event alarm level, the larger the value, the higher the

level, and the more attention should be paid.

-3: RED
-2: YELLOW
-1: GREEN
-0: N/A
• cgy: string, event category(category)
-"sys": System
elog object
-"alm": Alarm
-"nty": Notification
-"msg": Message
• cls: string, event class(class)
-"arm": arm operation
-"disarm": disarm operation
-"home": operate at home
-"alarm": alarm operation
-"M": indicates that the trigger is Motion IO
-"TR": indicates that the trigger is TR IO
-"A": indicates that the trigger is ALARM IO
-"open": KeyPad user unlock
-"add[nfc]": Add KeyPad NFC card user
-"add[key]": Add KeyPad Password User
-Other IO: indicate other device IO trigger events in the
defence area.
obj: string, related objects involved, refer to elog scenario

definition examples.

info: string, "0" usually indicates success and "1" usually

indicates failure.

lc: string, the corresponding defense area ID,the format is

"${AGT}/me/lc",If it is a sub-defense area then it is

"${AGT}/me/lc/sub/${AREA_ID}". Note: If operate a KeyPad

device, the lc has other definitions, refer to the elog scenario

definition example for details.

Examples of scene definitions:

IO change event:

Valid fileds: userid,agt,me,idx,devtype,type,val,v,ts

e.g. plug turn on event:

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2ad5","idx":"L1",

"type":129,"val":1,"devtype":"SL_SW_RC","ts":1521455567867},"id":1}

e.g. environment sensor humidity change event:


{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"H",

"type":95,"val":462,"v":46.2,"devtype":"SL_SC_THL","ts":1521532876138},"id":1}

Device online event:

Valid fileds: userid,agt,me,idx="s",devtype,v=1,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

devtype":"SL_SF_IF3","v":1,"ts":1521532876138},"id":1}

Device offline event:

Valid fileds: userid,agt,me,idx="s",devtype,,v=2,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

devtype":"SL_SF_IF3","v":2,"ts":1521532876138},"id":1}

Modify device name event:

Valid fileds: userid,agt,me,idx="s",devtype,info="name",name,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

info":"name","name":"NEW_NAME","devtype":"SL_SF_IF3","ts":1521532876138},"id":1}

Modify IO name event:

Valid fileds: userid,agt,me,idx="s",devtype,info="ioname",name,io,ts


{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

info":"ioname","name":"NEW_IO_NAME","io":"L2","devtype":"SL_SF_IF3","ts":1521532876138},

"id":1}

Add Device event:

Valid fileds: userid,agt,me,idx="s",devtype,info="add",v=0,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

info":"add","devtype":"SL_SF_IF3","v":0,"ts":1521532876138},"id":1}

Delete Device event:

Valid fileds: userid,agt,me,idx="s",devtype,info="del",v=-1,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","

info":"del","devtype":"SL_SF_IF3","v":-1,"ts":1521532876138},"id":1}

Add Smart Station event:

Valid fileds: userid,agt,idx="s",devtype="agt",info="add",v=0,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"add","

devtype":"agt","v":0,"ts":1521532876138},"id":1}
Delete Smart Station event:

Valid fileds: userid,agt,idx="s",devtype="agt",info="del",v=-1,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"del","d

evtype":"agt","v":-1,"ts":1521532876138},"id":1}

Smart Station online event:

Valid fileds: userid,agt,idx="s",devtype="agt",v=1,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","devtype":"ag

t","v":1,"ts":1521532876138},"id":1}

Smart Station offline event:

Valid fileds: userid,agt,idx="s",devtype="agt",v=2,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","devtype":"ag

t","v":2,"ts":1521532876138},"id":1}

Smart Station full content synchronization event:

Valid fileds: userid,agt,idx="s",devtype="agt",info="full",ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"full","d

evtype":"agt","ts":1521532876138},"id":1}
Add AI event:

Valid fileds: userid,agt,me,idx="s",devtype="ai",info="add",v=0,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","

idx":"s","info":"add","devtype":"ai","v":0,"ts":1544609170932},"id":1}

Delete AI event:

Valid fileds: userid,agt,me,idx="s",devtype="ai",info="del",v=-1,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","

idx":"s","info":"del","devtype":"ai","v":-1,"ts":1544609265325},"id":1}

AI change event – modify name:

Valid fileds: userid,agt,me,idx="s",devtype="ai",info="chg",name,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","

idx":"s","info":"chg","devtype":"ai","name":"NewName","ts":1544609265325},"id":1}

AI change event – modify configuration:

Valid fileds: userid,agt,me,idx="s",devtype="ai",info="chg",cmdlist,ts


{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","

idx":"s","info":"chg","devtype":"ai","cmdlist":True,"ts":1544609265325},"id":1}

AI change event – status change:

Valid fileds: userid,agt,me,idx="s",devtype="ai",info="chg",stat,ts

{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","

idx":"s","info":"chg","devtype":"ai","stat":3,"ts":1544609265325},"id":1}

Example of elog scenario definition:

Armed state, there are security device events generated

elog field definition:

•cgy="alm",

•cls=IO attribute of the device triggering the event, such as "TR", "A", "M", lvl=3,

•info="0",

•obj=device ID, the format is "${AGT}/me/ep/${ME_ID}",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}", no

defense area is ""

•Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s",

devtype="elog", ts=1675662554000, elog={cgy="alm", cls="TR", lvl=3, info="0",

obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722}",

lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Disarm state, there are security device events generated

elog field definition:

•cgy="ntf",

•cls=IO attribute of the device triggering the event,such as"TR","A","M",

•lvl=2,

•info="0",

•obj=device ID, the format is "${AGT}/me/ep/${ME_ID}",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}", no

defense area is ""

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="nty", cls="TR", lvl=2, info="0",

obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722", lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

There are security device events disappear

elog field definition:

•cgy="msg",

•cls=IO attribute of the device triggering the event,such as"TR","A","M",

•lvl=1,

•info="0",

•obj=device ID, the format is "${AGT}/me/ep/${ME_ID}",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}",no

defense area is ""


Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="msg", cls="TR", lvl=1, info="0",

obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722", lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

Arm operation

elog field definition:

•cgy="sys",

•cls="arm",

•lvl=0,

•info="0",

•obj="The LifeSmart user ID that performed the operation",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="arm", lvl=0, info="0", obj="7722454",

lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

Disarm operation

elog field definition:

•cgy="sys",

•cls="disarm",

•lvl=0,

•info="0",
•obj="The LifeSmart user ID that performed the operation",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="disarm", lvl=0, info="0", obj="7722454",

lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

Operate at home

elog field definition:

•cgy="sys",

•cls="home",

•lvl=0,

•info="0",

•obj="The LifeSmart user ID that performed the operation",

•lc=defense area ID, the format is "${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="home", lvl=0, info="0", obj="7722454",

lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

Alarm operation

elog field definition:

•cgy="alm",

•cls="alarm",

•lvl=3,
•info="0",

•obj="The LifeSmart user ID that performed the operation",

•lc=defense area ID, the format is"${AGT}/me/lc"or"${AGT}/me/lc/sub/${area_id}"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="alm", cls="alarm", lvl=0, info="0", obj="7722454",

lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}

Add KeyPad NFC user successfully

elog field definition:

•cgy="sys",

•cls="add[nfc]",

•lvl=0,

•info="0",

•obj="Newly created KeyPad user ID",

•lc="Operating terminal and management account"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="add[nfc]", lvl=0, info="0", obj="21",

lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}

Add KeyPad NFC user failed

elog field definition:

•cgy="sys",
•cls="add[nfc]",

•lvl=0,

•info="1",

•obj="",

•lc="Operating terminal and management account"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="add[nfc]", lvl=0, info="1", obj="",

lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}

Add KeyPad password user successfully

elog field definition:

•cgy="sys",

•cls="add[key]",

•lvl=0,

•info="0",

•obj="Newly created KeyPad user ID",

•lc="Operating terminal and management account"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="add[key]", lvl=0, info="0", obj="22",

lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}

KeyPad user unlocked successfully

elog field definition:


•cgy="sys",

•cls="open",

•lvl=0,

•info="0",

•obj="The action object for unlocking, either lock device IO or scenario mode AI", the

format is "ep/${ME}/m/${IO_IDX}",

•lc="Operating terminal and KeyPad user ID"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="open", lvl=0, info="0", obj="ep/2711/m/P1",

lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}

KeyPad user unlocked failed

elog field definition:


•cgy="sys",

•cls="open",

•lvl=0,

•info="1",

•obj="The action object for unlocking, either lock device IO or scenario mode AI", the

format is "ep/${ME}/m/${IO_IDX}",

•lc="Operating terminal and KeyPad user ID"

Example:userid="7722454", agt="A3QAAABmAFAGRzczXXXXXX", idx="s", devtype="elog",

ts=1675662554000, elog={cgy="sys", cls="open", lvl=0, info="1", obj="ep/2711/m/P1",

lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}
8.LifeSmart Account API

!(This type of interface is limited and open, and it is not recommended for non-enterprise

users and those who do not use this requirement)

8.1.Register Account

If you don't have a LifeSmart account, the Application can create account through this

interface and automatically authorize them.

Note:

If the Application does not have this permission, this interface cannot be used.

8.1.1.Request Specification

Type Definition Must Description

Interface Name RegisterUser Register a LifeSmart account

Partial URL auth.RegisterUser

Content Type application/json


HTTP Method POST

ver Y 1.0

lang Y en

sign Y Signature Value

system userid Y User ID, always "10001"

appkey Y appkey

time Y UTC timestamp, since January 1, 1970,

in seconds.

method Y RegisterUser
Request Content

email O Email, choose one from Email or

Mobile Phone Number

mobile O MobilePhone Number, choose one

from Email or Mobile Phone Number


params

pwd Y Password

nick O Nickname

rgn O Users’ region

id Y Message ID

Note:
rgn is a parameter that the developer needs to fill in according to actual needs, indicating the area

where the registered user is located, that is, the country or region where it is located. In principle, you

cannot leave it blank. If you leave it blank, the default is Mainland China (cn). For other areas, please

refer to Appendix 1. rgn is the abbreviation of the international domain name.

RegisterUser does not involve operations on existing users, so its userid and usertoken use the default

values userid="10001", usertoken="10001".

RegisterUser interface requests the address, and the developer needs to find the corresponding

svrrgnid according to the incoming rgn to use this method, refer to Appendix 1 and Appendix 2.

8.1.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

BaseURL+PartialURL,

BaseURL; please refer to Appendix 1:

If the service provider is "China", please choose: https://api.us.ilifesmart.com/app/;

If the service provider is "America", please choose: https://api.us.ilifesmart.com/app/;

If the service provider is "Europe", please choose: https://api.eur.ilifesmart.com/app/;

For specific server addresses, please refer to Appendix 2.

https://api.us.ilifesmart.com/app/auth.RegisterUser
● Request body:

{
"id": 963,
"method": "RegisterUser",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "10001",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447650170,
"sign": "SIGN_XXXXXXXX"
},
"params": {
"pwd": "password_XXX",
"email": "d@d.com",
"nick": "nickname_XXX"
}

● Signature original string:

method:RegisterUser,email:d@d.com,nick:nickname_XXX,pwd:password_XXX,time:14476
50170,userid:10001,usertoken:10001,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_X
XXXXXXX

● Response:

"id": 963,
"code": 0,

"userid": "70010",
"usertoken": "xxxxxxxx"

8.2.Deauthorize Account

The Applications can delete authorized users through this interface.

Note:

If the application does not have this permission, this interface cannot be used, and the user is an

authorized user.

8.2.1.Request Specification

Type Definition Must Description

Interface Name UnregisterUser Deauthorize LifeSmart account

Partial URL auth.UnregisterUser

Content Type application/json

HTTP Method POST

ver Y 1.0

Request Content system lang Y en

sign Y Signature Value


userid Y user id

appkey Y appkey

time Y UTC timestamp, since January

1, 1970, in seconds.

method Y UnregisterUser

params O

id Y Message ID

8.2.2.Example

● We suppose:

appkey is APPKEY_XXXXXXXX, need to fill in real data;

apptoken is APPTOKEN_XXXXXXXX, need to fill in real data;

userid is USERID_XXXXXXXX, need to fill in real data;

usertoken is USERTOKEN_XXXXXXXX, need to fill in real data;

sign is SIGN_XXXXXXXX, need to fill in real sign data;

● URL:

svrurl+PartialURL, for example:

https://api.us.ilifesmart.com/app/auth.UnregisterUser

● Request body:

{
"id": 963,
"method": "UnregisterUser",
"system": {
"ver": "1.0",

"lang": "en",

"userid": "USERID_XXXXXXXX",

"appkey": "APPKEY_XXXXXXXX",

"time": 1447650170,
"sign": "SIGN_XXXXXXXX"
},
"params": {}

● Signature original string:

method:UnregisterUser,time:1447650170,userid:USERID_XXXXXXXX,usertoken:USERTOK
EN_XXXXXXXX,appkey:APPKEY_XXXXXXXX,apptoken:APPTOKEN_XXXXXXXX

● Response:

"id": 963,

"code": 0,

"msg": "success"

}
Appendix 1 Country abbreviations and svrrgnid

国际域
服务提供地 Server 服务代号
名缩写 国家或地区 Countries and Regions
Location svrrgnid
rgn
ae 阿拉伯联合酋长国 United Arab Emirates America AME

ag 安提瓜和巴布达 Antigua and Barbuda America AME

am 亚美尼亚 Armenia Europe EUR

apz 亚太地区 Asia Pacific Asia Pacific APZ

ar 阿根廷 Argentina America AME

at 奥地利 Austria Europe EUR

au 澳大利亚 Australia America AME

bb 巴巴多斯 Barbados America AME

bd 孟加拉国 Bangladesh Asia Pacific APZ

be 比利时 Belgium Europe EUR

bg 保加利亚 Bulgari Europe EUR

bh 巴林 Bahrain America AME

bn 文莱 Brunei Asia Pacific APZ

bo 玻利维亚 Bolivia America AME

br 巴西 Brazil America AME

bs 巴哈马 Bahamas America AME

by 白俄罗斯 Belarus Europe EUR

bz 伯利兹 Belize America AME

ca 加拿大 Canada America AME

ch 瑞士 Switzerland Europe EUR

cl 智利 Chile America AME

cn 中国(旧区) China China(old) CN0

cn1 酒店和公司用户 Hotel and Corporate users China(special) VIP1

cn2 中国(新区) China China(new) CN2

co 哥伦比亚 Colombia America AME


cr 哥斯达黎加 Costa Rica America AME

cy 塞浦路斯 Cyprus Europe EUR

cz 捷克 Czech Republic Europe EUR

de 德国 Germany Europe EUR

dk 丹麦 Denmark Europe EUR

dm 多米尼克 Dominica America AME

do 多米尼加共和国 Dominica Rep America AME

dz 阿尔及利亚 Algeria America AME

ec 厄瓜尔多 Ecuador America AME

ee 爱沙尼亚 Estonia Europe EUR

eg 埃及 Egypt America AME

es 西班牙 Spain Europe EUR

et 埃塞俄比亚 Ethiopia America AME

fi 芬兰 Finland Europe EUR

fr 法国 France Europe EUR

gb 英国 United Kingdom Europe EUR

gd 格林纳达 Grenada America AME

gh 加纳 Ghana America AME

gr 希腊 Greece Europe EUR

gt 危地马拉 Guatemala America AME

gy 圭亚那 Guyana America AME

hk 中国香港 China. HongKong America AME

hn 洪都拉斯 Honduras America AME

hr 克罗地亚 Croatia Europe EUR

hu 匈牙利 Hungary Europe EUR

id 印度尼西亚 Indonesia America AME

ie 爱尔兰 Ireland Europe EUR

il 以色列 Israel America AME

in 印度 India America AME


iq 伊拉克 Republic Of Iraq Asia Pacific APZ

ir 伊朗 Iran America AME

is 冰岛 Iceland Europe EUR

it 意大利 Italy Europe EUR

jm 牙买加 Jamaica America AME

jo 约旦 Jordan America AME

jp 日本 Japan America AME

ke 肯尼亚 Kenya America AME

kh 柬埔寨 Cambodia America AME

kr 韩国 Korea America AME

kw 科威特 Kuwait America AME

kz 哈萨克斯坦 Kazakhstan Asia Pacific APZ

lc 圣卢西亚 St.Lucia America AME

li 列士敦士登 Liechtenstein Europe EUR

lk 斯里兰卡 Sri Lanka Asia Pacific APZ

lt 立陶宛 Lithuania Europe EUR

lu 卢森堡 Luxembourg Europe EUR

lv 拉脱维亚 Latvia Europe EUR

ma 摩洛哥 Morocco America AME

md 摩尔多瓦 Moldova, Republic of Europe EUR

me 黑山共和国 Montenegro Europe EUR

mk 马其顿 Macedonia Europe EUR

mm 缅甸 Myanmar Asia Pacific APZ

mn 蒙古 Mongolia Asia Pacific APZ

mo 中国澳门 China. Macao America AME

mt 马耳他 Malta Europe EUR

mu 毛里求斯 Mauritius America AME

mx 墨西哥 Mexico America AME

my 马来西亚 Malaysia Asia Pacific APZ


ng 尼日利亚 Federal Republic of Nigeria America AME

ni 尼加拉瓜 Nicaragua America AME

nl 荷兰 Netherlands Europe EUR

no 挪威 Norway Europe EUR

np 尼泊尔 Nepal Asia Pacific APZ

nz 新西兰 New Zealand America AME

om 阿曼 Oman America AME

pa 巴拿马 Panama America AME

pe 秘鲁 Peru America AME

ph 菲律宾 Philippines Asia Pacific APZ

pk 巴基斯坦 Pakistan Asia Pacific APZ

pl 波兰 Poland Europe EUR

pt 葡萄牙 Portugal Europe EUR

py 巴拉圭 Paraguay America AME

qa 卡塔尔 Qatar America AME

ro 罗马尼亚 Romania Europe EUR

rs 塞尔维亚 Serbia Europe EUR

ru 俄罗斯 Russia Europe EUR

sa 沙特阿拉伯 Saudi Arabia America AME

se 瑞典 Sweden Europe EUR

sg 新加坡 Singapore Asia Pacific APZ

si 斯洛文尼亚 Slovenia Europe EUR

sk 斯洛伐克 Slovakia Europe EUR

sr 苏里南 Suriname America AME

sv 萨尔瓦多 EI Salvador America AME

th 泰国 Thailand Asia Pacific APZ

tr 土耳其 Turkey Europe EUR

tt 特立尼达和多巴哥 Trinidad and Tobago America AME

tw 中国台湾省 China. Taiwan America AME


ua 乌克兰 Ukraine Europe EUR

us 美国 United States of America America AME

uy 乌拉圭 Uruguay America AME

ve 委内瑞拉 Venezuela America AME

vn 越南 Vietnam Asia Pacific APZ

za 南非 South Africa America AME

Appendix 2 Svrrgnid and Server URL

Service Type svrrgnid URL

GS https://api.ilifesmart.com/app/

CN0 https://api.cn0.ilifesmart.com/app/

VIP1 https://api.cn1.ilifesmart.com/app/

CN2 https://api.cn2.ilifesmart.com/app/
OpenAPI URL
AME https://api.us.ilifesmart.com/app/

EUROPE https://api.eur.ilifesmart.com/app/

JAP https://api.jp.ilifesmart.com/app/

APZ https://api.apz.ilifesmart.com/app/

You might also like