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 | <Boolean,Necessary> | Current outlet state;true means ON and false is OFF; |
| 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 |
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 | <Boolean,Necessary> | true means ON and false is OFF; |
Same as Outlet.getState
3.Outlet.setDelayOn
Delay to turn on outlet.
| Param | Value | Desc |
|---|---|---|
| method | Outlet.setDelayOn | 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.time | <Integer,Necessary> | The time you want to Delay ON;Unit of minute;0 is cancel delay; |
Same as Outlet.getState
4.Outlet.setDelayOff
Delay to turn off outlet.
| Param | Value | Desc |
|---|---|---|
| method | Outlet.setDelayOff | Delay to turn off outlet. |
| targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
| token | <String,Necessary> | Net token of the Outlet you use; |
| params.time | <Integer,Necessary> | The time you want to Delay OFF;Unit of minute;0 is cancel delay |
Same as Outlet.getSchedules
5.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.Schedules[*].index | <Integer,Necessary> | Index of this record ; |
| data.Schedules[*].onTime | <String,Necessary> | Time to turn on; HH:mm |
| data.Schedules[*].offTime | <String,Necessary> | Time to turn off; HH:mm |
| data.Schedules[*].weekMask | <Integer,Necessary> | mask of effected days(Sunday to Saturday) |
6.Outlet.setSchedule
Set Schedule
| Param | Value | Desc |
|---|---|---|
| method | Outlet.setSchedule | Set Schedule. |
| targetDevice | <String,Necessary> | DeviceId of the Outlet you use; |
| token | <String,Necessary> | Net token of the Outlet you use; |
| params.index | <Integer,Necessary> | Index of this record ;Update it when record existed or insert it otherwise;6 records limited. |
| params.onTime | <String,Necessary> | Time to turn on; HH:mm |
| params.offTime | <String,Necessary> | Time to turn off; HH:mm |
| params.weekMask | <Integer,Necessary> | mask of effected days(Sunday to Saturday) |
| Param | Value | Desc |
|---|
7.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; |
8.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; |
9.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.Outlet.getState>