Switch
1.Switch.getState
Get Current State
Param | Value | Desc |
---|---|---|
method | Switch.getState | Get Current State |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch you use; |
Param | Value | Desc |
---|---|---|
data.state | <List<Boolean>,Necessary> | Current Switch state;true means ON and false is OFF;max length of List is 3 , means at most 3 buttons in one switch; |
data.delay.zone | <Integer,Necessary> | The effective zone(the index of buttons;0-2;) of delay ON/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.Switch.setState
Set Switch's State
Param | Value | Desc |
---|---|---|
method | Switch.setState | Set Switch's State |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch you use; |
params.zone | <Integer,Necessary> | The zone you want to set state(ON/OFF);0-2 means the index of buttons;default is 0;255 means ALL zones; |
params.state | <Boolean,Necessary> | true means ON and false is OFF; |
Same as Switch.getState
3.Switch.setDelayOn
Delay to turn on Switch.
Param | Value | Desc |
---|---|---|
method | Switch.setDelayOn | Delay to turn on Switch. |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch you use; |
params.zone | <Integer,Necessary> | The zone you want to Delay ON;0-2 means the index of buttons;default is 0; |
params.time | <Integer,Necessary> | The time you want to Delay ON;Unit of minute;0 is cancel delay; |
Same as Switch.getState
4.Switch.setDelayOff
Delay to turn off Switch.
Param | Value | Desc |
---|---|---|
method | Switch.setDelayOff | Delay to turn off Switch. |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch you use; |
params.zone | <Integer,Necessary> | The zone you want to Delay OFF;0-2 means the index of buttons;default is 0; |
params.time | <Integer,Necessary> | The time you want to Delay OFF;Unit of minute;0 is cancel delay |
Same as Switch.getSchedules
5.Switch.getSchedules
Get Schedule List
Param | Value | Desc |
---|---|---|
method | Switch.getSchedules | Get Schedule List. |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch 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[*].zoneMask | <Integer,Necessary> | Mask of effected zones |
data.Schedules[*].weekMask | <Integer,Necessary> | Mask of effected days(Sunday to Saturday) |
6.Switch.setSchedule
Set Schedule
Param | Value | Desc |
---|---|---|
method | Switch.setSchedule | Set Schedule. |
targetDevice | <String,Necessary> | DeviceId of the Switch you use; |
token | <String,Necessary> | Net token of the Switch 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.zoneMask | <Integer,Necessary> | Mask of effected zones |
params.weekMask | <Integer,Necessary> | Mask of effected days(Sunday to Saturday) |
Param | Value | Desc |
---|
7.Switch.getVersion
Get firmware info
Param | Value | Desc |
---|---|---|
method | Switch.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.Switch.startUpgrade
Start Upgrade
Param | Value | Desc |
---|---|---|
method | Switch.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.Switch.getState>