LifeSmart Cloud Platform API
LifeSmart Cloud Platform API
38)
Description;
attributes;
Ep/IO;
1.19 2019/03/01 Jon Fan Add EpSet interface to modify the description of
1.20 2019/06/03 Jon Fan Added the description of the v value in the device
interface;
returned by authorization;
description;
description;
method description;
description
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
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
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.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
did string (Optional) The unique id of the terminal device, which can
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.】
(except apptoken) is generated in alphabetical order. If there is did, then input it into the
b) Encrypt the initial signature string using MD5, and transform it to 32 bits 16-lowercase-string
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:
appkey=1111111111&auth_callback=http://localhost:8080/CallBack.ashx&time=1445307713&
apptoken=ABCDEFGHIKJLMJOBPOOFPDFDA
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
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.
"code": "success",
"userid": "YOUR_USERID",
"usertoken": "YOUR_TOKEN",
"expiredtime": YOUR_EXPIRED_TIME,
"rgn": "USER_RGN",
"svrurl": "USER_SERVERURL",
"svrrgnid": "USER_SEVER_RGNID"
"code": "error",
"message": "ERR_MESSAGE"
id int Message ID
1970, in seconds
data correctly.
svrrgnid string The area ID of the user, such as "GS". Because of the
is currently located.
3.4.Refresh Usertoken
The usertoken must be refreshed before the expiration time, otherwise the user must be re-
authorized.
E.g:
Obtained by user A after successful authorization:
svrurl="https://api.us.ilifesmart.com/app/",
c) Request parameters:
d)
d) Signature original string:
appkey=***&did=***&time=***&userid=***&apptoken=***&usertoken=***
order.
f) After the call is successful, the following information will be returned (JSON format):
Name Type Description
id int Message ID
message is returned
1970, in seconds
g) E.g:
● We suppose:
● Request body:
{
"appkey": "APPKEY_XXXXXXXX",
"time": 1445307713,
"userid": "1111111",
"sign": "SIGN_XXXXXXXX",
"id": 12345
}
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.1.URL
Protocol: HTTPS
URL: Please use the server address returned by the authorization interface (svrurl field)
(European Region:https://api.eur.ilifesmart.com/app/)
Specific service addresses list please refer to Appendix 2 svrrgnid and server address.
id Message ID
password etc
● ATTR_VALUE: attribute value, find more detail in "LifeSmart Attribution of Smart Device"
Field Description
id Message ID
code Successful: 0;
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
4.2.1.Signature Algorithm
To complete the signature algorithm, the following two steps are required:
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
"<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
Note:
● Before Application accesses to the Platform, it must obtains the appkey and apptoken, see
● 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,
"method:TestMethod,param1:12345,param2:abcde,did:DID_XXXXXXXX,time:1445307713,use
rid:1111111,usertoken:abcdefghijklmnopqrstuvwx,appkey:APPKEY_XXXXXXXX,apptoken:ABC
DEFGHIKJLMJOBPOOFPDFDA"
sign=MD5("method:TestMethod,param1:12345,param2:abcde,did:DID_XXXXXXXX,time:1445
307713,userid:1111111,usertoken:abcdefghijklmnopqrstuvwx,appkey:APPKEY_XXXXXXXX,app
token:ABCDEFGHIKJLMJOBPOOFPDFDA")
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
• The usertoken is invalid, that is, the usertoken passed in through the interface is wrong or expired,
0 Success
4.4.Device Model
In order to facilitate the understanding of the API, here we give a brief description of the
"agt": "A3EAAABtAEwQXXXXXXXXXX",
"me": "2d11",
"devtype": "SL_SW_IF3",
"fullCls": "SL_SW_IF3_V2",
"stat": 1,
"data": {
"L1": {"type": 129, "val": 1,"name": "Living"},
},
• 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
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
• After the smart device is added to the Smart Station, calling EpGetAllAgts will not return.
fullCls string The complete device Type including the version number,
to identify the device Type. You need to use fullCls when you
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
users to understand.
Note:
val values.
data[IDX].name string The name of the specific IO port. (Note: if the IO port has
lHeart int32 The last heartbeat time of the device; UTC timestamp, since
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
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
me_self string The "me" attribute of the smart device itself. If a smart
attribute of device A
Name Type Description
Type.
4.5.1.1.Request Specification
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
system
did O (Optional) The unique id of
method Y EpAddAgt
4.5.1.2.
4.5.1.2.Example
● We suppose:
● URL:
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"
}
}
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.1.Request Specification
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
is filled in during
Request Content
authorization, the same
January 1, 1970, in
seconds
method Y EpDeleteAgt
id Y Message ID
4.5.2.2.
4.5.2.2.Example
● We suppose:
● URL:
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.1.Request Specification
ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value
userid Y User ID
appkey Y appkey
method Y EpGetAllAgts
id Y Message ID
4.5.3.2.
4.5.3.2.Example
● We suppose:
● 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"
}
}
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.1.Request Specification
URL api.EpAdd
ver Y 1.0
lang Y en
userid Y User id
appkey Y appkey
did O (Optional) The unique id of the
filled here.
1970, in seconds.
method Y EpAdd
EpGetAllAgts
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
4.5.4.2.Example
● We suppose:
● URL:
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"
}
}
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,
parameters. If the device has no additional parameters, the value of this parameter will be
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
category on the LCD screen of the multi-function (CUBE) environmental sensor. You can
respectively.
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.
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
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:
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.
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
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.1.Request Specification
ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value
userid Y User ID
appkey Y appkey
here.
January 1, 1970, in
seconds.
method Y EpRemove
deleted, it is the
returns
params
me Y me of the device to be
deleted, it is the
returns
id Y Message ID
4.5.5.2.
4.5.5.2.Example
● We suppose:
● URL:
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"
}
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.1.Request Specification
t
Interface Name EpGetAll Get all device information
permission).
ver Y 1.0
lang Y en
userid Y User id
be filled here.
time Y UTC timestamp, since January 1,
1970, in seconds.
method Y EpGetAll
information, including
agt,me,devtype,name,stat
1: Return data
3: return agt_self
id Y Message ID
4.5.6.2.
4.5.6.2.Example
● We suppose:
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"
}
}
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"},
"lDbm": -35,
"lHeart": 1539143970
},{
"agt": "A3EAAABdADQQXXXXXXXXXX",
"me": "2713",
"devtype": "SL_LI_RGBW",
"name": "bulb",
"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
ver Y 1.0
lang Y en
userid Y User id
appkey Y appkey
Request Content system
be filled here.
method Y EpGet
information returned by
EpGetAll
returned by EpGetAll
Id Y Message ID
4.5.7.2.
4.5.7.2. Example
● We suppose:
● URL:
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"
}
}
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"},
"lDbm": -35,
"lHeart": 1539143970
}]
userid Y User id
appkey Y appkey
filled here.
in seconds.
method Y EpGet
returned by EpGetAll
returned by EpGetAll
params
Note:
function.
Note:
id Y Message ID
4.5.8.2.
4.5.8.2.Example
● We suppose:
● URL:
● 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"
}
}
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"
}
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;
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:
"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
ver Y 1.0
lang Y en
userid Y User ID
filled here.
time Y UTC timestamp, since January 1,
1970, in seconds.
method Y EpsSet
args.
params Note:
function.
Yes)
Note:
id Y Message ID
4.5.9.2.
4.5.9.2.Example
● We suppose:
● URL:
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}]",
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
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
did O (Optional) The unique id of the
filled here.
in seconds.
method Y SceneGet
id Y Message ID
4.5.10.2.
4.5.10.2.Example
● We suppose:
● URL:
● 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",
}
}
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.1.Request Specification
ver Y 1.0
Request Content system
lang Y en
sign Y Signature Value
userid Y User ID
appkey Y appkey
filled here.
1970, in seconds.
method Y SceneSet
params
type O Parameter value of the scene to be
set
set
id Y Message ID
4.5.11.2.
4.5.11.2.Example
● We suppose:
● URL:
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",
}
}
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
groupsw One click args type 0x81:ON Turn on/off one group
RGBW 4byte:WRGB
and turn it on
RGBW 4byte:WRGB
4.5.12.1.Request Specification
Name
userid Y User ID
appkey Y appkey
seconds.
method Y EpUpgradeAgt
The default is 1)
nonResp O Whether wait for Smart Station complete
id Y Message ID
4.5.12.2.
4.5.12.2.Example
● We suppose:
● URL:
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",
}
}
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.
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
Name
ver Y 1.0
lang Y en
userid Y User ID
Request
appkey Y appkey
system
Content
did O (Optional) The unique id of the terminal. If it
seconds.
method Y EpRebootAgt
id Y Message ID
4.5.13.2.
4.5.13.3.
4.5.13.2.Example
● We suppose:
● URL:
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"
}
}
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
Station)
4.5.14.1.Request Specification
Name on
ersion
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
seconds.
method Y EpGetAgtLatestVersion
id Y Message ID
4.5.14.2.
4.5.14.3.
4.5.14.2.Example
● We suppose:
● 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"
}
}
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
Note:
For the current version number of the Smart Station, please refer to the agt_ver attribute of the Smart
4.5.15.1.Request Specification
ver Y 1.0
Request lang Y en
system
Content sign Y Signature Value
userid Y User ID
appkey Y appkey
seconds.
method Y EpSearchSmart
"auto".
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;
● URL:
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:
* 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.1.Request Specification
description.
ver Y 1.0
Request
system lang Y en
Content
appkey Y appkey
seconds.
method Y EpAddSmart
id Y Message ID
4.5.16.2.
4.5.16.2.Example
● We suppose:
● URL:
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",
}
}
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
● 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.1.Request Specification
Name
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
seconds.
method Y EpGetAgtState
id Y Message ID
4.5.17.2.
4.5.17.2.Example
● We suppose:
● URL:
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"
}
}
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.1.Request Specification
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
system
seconds.
method Y EpCmd
params me Y Device ID
id Y Message ID
4.5.18.2.
4.5.18.2.Example
● We suppose:
● URL:
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",
● 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
is: [1,7].
attributes:
play.
parameter is True.
Note:
Camera.
4.5.19.EpSetVar (Set Devices by Low-Level Command)
4.5.19.1.Request Specification
Name
ver Y 1.0
lang Y en
seconds.
method Y EpSetVar
me Y Device ID
params
cmd Y Command number, Integer type
type
id Y Message ID
4.5.19.2.
4.5.19.2.Example
● We suppose:
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,
● 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,
cmd: 0, Energy
cmddata: [0, 0, 0] Usage) Note: After clearing, if you directly check the
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.1.Request Specification
Name
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
system
seconds.
method Y EpGetAttrs
id Y Message ID
4.5.20.2.
4.5.20.2.Example
● We suppose:
● URL:
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\"]"
}
}
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
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
4.5.21.1.Request Specification
Name
Partial URL api.EpTestRssi
ver Y 1.0
lang Y en
userid Y User ID
appkey Y appkey
system
seconds.
method Y EpTestRssi
Station
args N Extended attribute, is the serialized string
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:
● URL:
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"
}
}
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
than the back noise threshold, it means that the site environment is bad and it has
Rssi is the received signal strength indicator, and its value is a positive number. The
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
than the back noise threshold, it means that the site environment is bad and it has
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.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.
Name
ver Y 1.0
lang Y en
userid Y User ID
Request
system
appkey Y appkey
Content
method Y EpBatchSet
the device
respectively is:
• 0: normal
• 1: fast
• 2: extreme
The default is 0.
id Y Message ID
4.5.22.2.Example
● We suppose:
● URL:
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:
● 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
If the current speed is in extreme mode, the failedIoItems property will not be returned.
Value
Parameter Parameter Description
Value
0 normal(default)
The command is executed in the normal way, all command operations are
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
accuracy]
1 fast
Execute one time quickly and do not wait the feedback. Then excute again
The first-time execution ensures that most of the sub-devices are quickly
The second execution ensures that the failed command during the first
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
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-
However, this method will still ensure that most of the child device
execution is successful, and the interface call takes the shortest time.
guarantee of accuracy]
4.5.23.EpSearchIDev (Search for nearby IP network Device)
4.5.23.1.Request Specification
to Smart Station.
userid Y User ID
appkey Y appkey
seconds.
method Y EpSearchIDev
"auto"
id Y Message ID
4.5.23.2.
4.5.23.2.Example
● We suppose:
● URL:
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"
}
}
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": "",
"dhcp": true
}]
}
Response Description:
* ttl: The number of TTLs in the search process, which can be used to diagnose the
network;
* defPwd: The default login account password 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
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
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
5. For devices that do not support extended information, exinfo may be empty object or a string of
length is 0;
4.5.24.1.Request Specification
ver Y 1.0
lang Y en
userid Y User ID
Request
system
appkey Y appkey
Content
method Y EpAddIDev
returned by EpSearchIDev.
returned by EpSearchIDev.
returned by EpSearchIDev.
params
port Y Port of the network device that want to add,
by EpSearchIDev.
be left void.
4.5.24.2.Example
● We suppose:
● URL:
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": ""
}
}
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
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
ver Y 1.0
lang Y en
seconds.
method Y EpMaintOtaFiles
Station;
OTA file
actargs O Operation command parameters, the data is
following:
provided;
OTA file;
id Y Message ID
4.5.25.2.Example
● We suppose:
● URL:
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
ver Y 1.0
lang Y en
seconds.
method Y EpMaintOtaTasks
it can be as following:
finished
following:
params
provided;
completed
id Y Message ID
4.5.26.2.Example
● We suppose:
● URL:
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"
}
}
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
file: The file name of the current OTA file, which is also the key;
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
ver Y 1.0
lang Y en
seconds.
method Y EpMaintAgtRM
configurations
configurations
actargs Y Operation command parameter, the data is
following:
password;
4.5.27.2.Example - Backup
● We suppose:
● URL:
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",
}
}
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",
}
}
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
4.5.28.1.Request Specification
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
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
id Y Message id
4.5.28.2.Request Specification
● We suppose:
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\"}"
}
}
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.1.Request Specification
st
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
be filled here.
seconds.
method Y EpConfigAgt
canbe as following:
local login
login
password
zone
location
service
commands;
Definition is as following:
fullSync=0;
• setExSv:{svId,args={},reload=1/0}, configure
{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
{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
{svId,args={},reload=1/0}: Set
Extended Service.
1.svcId:indicates Extended Service
Id
2.args:indicates the configuration
{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;
4.5.29.3.Example - setLocalPermission
● We suppose:
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",
}
}
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,
{"stat": "locked"/"normal"}}, locked indicates that local login is prohibited, and normal indicates that
The set password is not allowed to be queried. The password is stored in the smart center with
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
• Weather service
svId: "weather",
args: {
},
svId: "lc_mdns",
args: {
"enable" : True/False ,indicates enable or not
},
"reload": 1/0 indicates reload to make effect
• 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:
agt="A3EAxxxxxxxxxxxxxxxx",me="4802",ai="AI_OI_1646821884"
Then the odjectID should be configured as:
"A3EAxxxxxxxxxxxxxxxx/me/ai/AI_OI_1646821884"
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:
me string R device ID
Online status
1:online
When calling the control interface of a smart device, please refer to the document:
It should be noted that some of the properties are not performed for OpenAPI Open, and only
6.Discovery Protocol
The discovery protocol defines a method for discovering smart devices such as Smart Station
Protocol UDP
or
MGAMOD=xxxxx\nLSID=xxxxx\nNAME=xxxxx\n
New versions of smart devices may also add new attributes, which will
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
Note:
●After connected successfully, the connection of WebSocket will keep alive, you can send
multiple times in one connection, achieve the effect of single connection and multiple
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:
VIP1 wss://api.cn1.ilifesmart.com:8443/wsapp/
CN2 wss://api.cn2.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
The svrrgnid of the authentication LifeSmart account must be consistent with the svrrgnid of
7.3.1.Request Specification
lang Y en
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
filled here.
1970, in seconds.
method Y WbAuth
id Y Message ID
7.3.2.Example
● We suppose:
● Request body:
{
"id": 957,
"method": "WbAuth",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}
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
ver Y 1.0
lang Y en
userid Y User id
appkey Y appkey
system
did O (Optional) The unique id of the
Request Content
filled here.
in seconds.
method Y RmAuth
id Y Message ID
7.4.2.Example
● We suppose:
● Request body:
{
"id": 957,
"method": "RmAuth",
"system": {
"ver": "1.0",
"lang": "en",
"userid": "1111111",
"appkey": "APPKEY_XXXXXXXX",
"time": 1447641115,
"sign": "SIGN_XXXXXXXX"
}
}
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
id Message ID
7.6.Event Specification
me string When it is Smart Station level event then its value does not exist;
T, O etc.
further judgement.
idx string
Device type
type int32 attributes, when idx="s" mark special events, the value of it is
invalid.
val int32 attributes, when idx="s" mark special events, the value of it is
invalid.
the true valid value of val, e.g. the temperature change event,
are as following:
syncronization;
status,configuraiton;
follows:
lvl: int32, Event alarm level, the larger the value, the higher the
-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.
indicates failure.
IO change event:
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2ad5","idx":"L1",
"type":129,"val":1,"devtype":"SL_SW_RC","ts":1521455567867},"id":1}
"type":95,"val":462,"v":46.2,"devtype":"SL_SC_THL","ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","
devtype":"SL_SF_IF3","v":1,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","
devtype":"SL_SF_IF3","v":2,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","
info":"name","name":"NEW_NAME","devtype":"SL_SF_IF3","ts":1521532876138},"id":1}
info":"ioname","name":"NEW_IO_NAME","io":"L2","devtype":"SL_SF_IF3","ts":1521532876138},
"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","
info":"add","devtype":"SL_SF_IF3","v":0,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"2aca","idx":"s","
info":"del","devtype":"SL_SF_IF3","v":-1,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"add","
devtype":"agt","v":0,"ts":1521532876138},"id":1}
Delete Smart Station event:
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"del","d
evtype":"agt","v":-1,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","devtype":"ag
t","v":1,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","devtype":"ag
t","v":2,"ts":1521532876138},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","idx":"s","info":"full","d
evtype":"agt","ts":1521532876138},"id":1}
Add AI event:
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","
idx":"s","info":"add","devtype":"ai","v":0,"ts":1544609170932},"id":1}
Delete AI event:
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","
idx":"s","info":"del","devtype":"ai","v":-1,"ts":1544609265325},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","
idx":"s","info":"chg","devtype":"ai","name":"NewName","ts":1544609265325},"id":1}
idx":"s","info":"chg","devtype":"ai","cmdlist":True,"ts":1544609265325},"id":1}
{"type":"io","msg":{"userid":"10001","agt":"A3EAAABtxxxxxxM0Njg5NA","me":"AI1544609170","
idx":"s","info":"chg","devtype":"ai","stat":3,"ts":1544609265325},"id":1}
•cgy="alm",
•cls=IO attribute of the device triggering the event, such as "TR", "A", "M", lvl=3,
•info="0",
obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722}",
lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Disarm state, there are security device events generated
•cgy="ntf",
•lvl=2,
•info="0",
obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722", lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
•cgy="msg",
•lvl=1,
•info="0",
obj="A3QAAABmAFAGRzczXXXXXX/me/ep/2722", lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Arm operation
•cgy="sys",
•cls="arm",
•lvl=0,
•info="0",
lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Disarm operation
•cgy="sys",
•cls="disarm",
•lvl=0,
•info="0",
•obj="The LifeSmart user ID that performed the operation",
lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Operate at home
•cgy="sys",
•cls="home",
•lvl=0,
•info="0",
lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
Alarm operation
•cgy="alm",
•cls="alarm",
•lvl=3,
•info="0",
lc="A3QAAABmAFAGRzczXXXXXX/me/lc"}
•cgy="sys",
•cls="add[nfc]",
•lvl=0,
•info="0",
lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}
•cgy="sys",
•cls="add[nfc]",
•lvl=0,
•info="1",
•obj="",
lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}
•cgy="sys",
•cls="add[key]",
•lvl=0,
•info="0",
lc="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}
•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="A3QAAABmAFAGRzczXXXXXX/me/ep/2765[1]"}
•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="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
8.1.Register Account
If you don't have a LifeSmart account, the Application can create account through this
Note:
If the Application does not have this permission, this interface cannot be used.
8.1.1.Request Specification
ver Y 1.0
lang Y en
appkey Y appkey
in seconds.
method Y RegisterUser
Request Content
pwd Y Password
nick O Nickname
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
RegisterUser does not involve operations on existing users, so its userid and usertoken use the default
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:
● URL:
BaseURL+PartialURL,
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"
}
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
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
ver Y 1.0
appkey Y appkey
1, 1970, in seconds.
method Y UnregisterUser
params O
id Y Message ID
8.2.2.Example
● We suppose:
● URL:
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": {}
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
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/