Outlet
1.Outlet.getState
Get Current State
Param | Value | Desc |
---|---|---|
method | Outlet.getState | Get Current State |
targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
token | <String,Necessary> | Net token of the Outlet you use; |
Param | Value | Desc |
---|---|---|
data.state | <String,Necessary> | State of device,["closed","open"]; |
data.delay.on | <Integer,Necessary> | The remain time of Delay ON;Unit of minute;0 is OFF |
data.delay.off | <Integer,Necessary> | The remain time of Delay OFF;Unit of minute;0 is OFF |
data.power | <Integer,Optional> | Current Power. If device not support it,it will be 0 |
data.version | <String,Necessary> | Firmware Version of device |
data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
2.Outlet.setState
Set Outlet's State
Param | Value | Desc |
---|---|---|
method | Outlet.setState | Set Outlet's State |
targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
token | <String,Necessary> | Net token of the Outlet you use; |
params.state | <String,Necessary> | Set state of device.["close","open"]; |
Param | Value | Desc |
---|---|---|
data.state | <String,Necessary> | State of device,["closed","open"]; |
3.Outlet.setDelay
Delay to turn on outlet.
Param | Value | Desc |
---|---|---|
method | Outlet.setDelay | Delay to turn on outlet. |
targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
token | <String,Necessary> | Net token of the Outlet you use; |
params.delayOn | <Integer,Optional> | The time you want to Delay ON;Unit of minute;0 is cancel delay; |
params.delayOff | <Integer,Optional> | The time you want to Delay OFF;Unit of minute;0 is cancel delay; |
Param | Value | Desc |
---|---|---|
data.delay.on | <Integer,Necessary> | The remain time of Delay ON;Unit of minute;0 is OFF |
data.delay.off | <Integer,Necessary> | The remain time of Delay OFF;Unit of minute;0 is OFF |
4.Outlet.getSchedules
Get Schedule List
Param | Value | Desc |
---|---|---|
method | Outlet.getSchedules | Get Schedule List. |
targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
token | <String,Necessary> | Net token of the Outlet you use; |
Param | Value | Desc |
---|---|---|
data[index].isValid | <Boolean,Necessary> | Enabled/Disabled ; |
data[index].index | <Integer,Necessary> | Index of this record ; |
data[index].on | <String,Optional> | Time to turn on; HH:mm |
data[index].off | <String,Optional> | Time to turn off; HH:mm |
data[index].week | <Integer,Necessary> | mask of effected days(Sunday to Saturday) |
5.Outlet.setSchedules
Set Schedule
Param | Value | Desc |
---|---|---|
method | Outlet.setSchedules | Set Schedule. |
targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
token | <String,Necessary> | Net token of the Outlet you use; |
params.sches | <Array<Schedule> | Map<int,Schedule>,Necessary> |
params.sches[index].isValid | <Boolean,Necessary> | Enabled/Disabled ; |
params.sches[index].index | <Integer,Necessary> | Index of this record ; |
params.sches[index].on | <String,Necessary> | Time to turn on; HH:mm |
params.sches[index].off | <String,Necessary> | Time to turn off; HH:mm |
params.sches[index].week | <Integer,Necessary> | mask of effected days(Sunday to Saturday) |
index from "0" to "5"
Same as Outlet.getSchedules
6.Outlet.getVersion
Get firmware info
Param | Value | Desc |
---|---|---|
method | Outlet.getVersion | Get firmware info; |
targetDevice | <String,Necessary> | DeviceId of this device; |
token | <String,Necessary> | Net Token of this device; |
Param | Value | Desc |
---|---|---|
data.version | <String,Necessary> | Current Version; |
data.newVersion.versionId | <String,Optional> | Id of the newest version; |
data.newVersion.versionCode | <String,Optional> | Code of the newest version; |
data.newVersion.fileSize | <String,Optional> | File Size of the newest version; |
7.Outlet.startUpgrade
Start Upgrade
Param | Value | Desc |
---|---|---|
method | Outlet.startUpgrade | Start Upgrade |
targetDevice | <String,Necessary> | DeviceId of this device; |
token | <String,Necessary> | Net Token of this device; |
params.versionId | <String,Necessary> | Version Id you want to upgrade; |
Param | Value | Desc |
---|---|---|
data.isStarted | <Boolean,Necessary> | Is upgrading started; |
8.Outlet.getActivityLogs
Used to retrieve device activity records through search parameters or retrieval key.
caution
"DEVICE.HISTORICAL_DATA.READ" permission is required to access this interface
Param | Value | Desc |
---|---|---|
method | Outlet.getActivityLogs | Get device's activity records |
targetDevice | <String,Necessary> | DeviceId of the device you use; |
token | <String,Necessary> | Net token of the device you use; You can get it here |
params.search | <Object,Optional> | Retrieve records through search parameters. |
params.search.startDate | <String,Necessary> | Specify the start date of the search scope, with "YYYY-MM-DD" formatted |
params.search.endDate | <String,Necessary> | Specify the end date of the search scope, with "YYYY-MM-DD" formatted |
params.retrievalKey | <string,Optional> | Retrieve records through retrieval key. |
Param | Value | Desc |
---|---|---|
data.logs | <Array,Necessary> | Records of device activity logs |
data.logs[*].id | <Array,Necessary> | Id of record |
data.logs[*].time | <Date,Necessary> | Time of record |
data.logs[*].data | <Object,Necessary> | Data of record |
data.retrievalKeys | <Object,Optional> | When search results are not fully returned in this data packet, retrieval keys will be provided for retrieving other results. |
data.retrievalKeys.next | <Object,Necessary> | It indicates that there is more data available and can be retrieved through this key. |
9.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.Outlet.getState>