Skip to main content

Switch

1.Switch.getState

Get Current State

BDDP

ParamValueDesc
methodSwitch.getStateGet Current State
targetDevice<String,Necessary>DeviceId of the Switch you use;
token<String,Necessary>Net token of the Switch you use;

BUDP

ParamValueDesc
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

BDDP

ParamValueDesc
methodSwitch.setStateSet 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;

BUDP

Same as Switch.getState

3.Switch.setDelayOn

Delay to turn on Switch.

BDDP

ParamValueDesc
methodSwitch.setDelayOnDelay 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;

BUDP

Same as Switch.getState

4.Switch.setDelayOff

Delay to turn off Switch.

BDDP

ParamValueDesc
methodSwitch.setDelayOffDelay 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

BUDP

Same as Switch.getSchedules

5.Switch.getSchedules

Get Schedule List

BDDP

ParamValueDesc
methodSwitch.getSchedulesGet Schedule List.
targetDevice<String,Necessary>DeviceId of the Switch you use;
token<String,Necessary>Net token of the Switch you use;

BUDP

ParamValueDesc
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

BDDP

ParamValueDesc
methodSwitch.setScheduleSet 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)

BUDP

ParamValueDesc

7.Switch.getVersion

Get firmware info

BDDP

ParamValueDesc
methodSwitch.getVersionGet firmware info;
targetDevice<String,Necessary>DeviceId of this device;
token<String,Necessary>Net Token of this device;

BUDP

ParamValueDesc
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

BDDP

ParamValueDesc
methodSwitch.startUpgradeStart 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;

BUDP

ParamValueDesc
data.isStarted<Boolean,Necessary>Is upgrading started;

9.Callbacks

You can receive it with Http Callback API or MQTT report topic

BUDP

<Same as 1.Switch.getState>