Skip to main content

DoorSensor

1.DoorSensor.getState

Get Door Sensor's State

BDDP

ParamValueDesc
methodDoorSensor.getStateGet Door Sensor's State
targetDevice<String,Necessary>DeviceId of the Sensor you use;
token<String,Necessary>Net token of the Sensor you use; You can get it here

BUDP

ParamValueDesc
data.state.online<Boolean,Necessary>Is device online
data.state.state<String,Necessary>State of this device, ["closed", "open", "error"]
data.state.battery<String,Necessary>Level of device's battery, 0 to 4 means empty to full
data.state.openRemindDelay<Integer,Optional>When device is still open past this time, an OpenRemind event triggered
data.state.alertInterval<Integer,Optional>Interval of Continuous Alert
data.state.version<String,Necessary>Firmware Version of device
data.reportAt<Date,Necessary>Time of reported
data.deviceId<String,Necessary>Id of device

2.DoorSensor.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

BDDP

ParamValueDesc
methodDoorSensor.getActivityLogsGet device's activity records
targetDevice<String,Necessary>DeviceId of the Sensor you use;
token<String,Necessary>Net token of the Sensor 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.

BUDP

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

3.DoorSensor.setAttributes

Set device's attributes

BDDP

ParamValueDesc
methodDoorSensor.setAttributesSet device's attributes
targetDevice<String,Necessary>DeviceId of the Sensor you use;
token<String,Necessary>Net token of the Sensor you use; You can get it here
params.openRemindDelay<Integer,Optional>Open remind in seconds [10-64800];
params.alertInterval<Integer,Optional>Alert interval in minutes [0-120];

BUDP

ParamValueDesc
params.openRemindDelay<Integer,Necessary>Open remind in seconds [10-64800];
params.alertInterval<Integer,Necessary>Alert interval in minutes [0-120];

4.Callbacks

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

BUDP

<Same as 1.DoorSensor.getState>