Skip to main content

LeakSensor

1.LeakSensor.getState

Get Leak Sensor's State

BDDP

ParamValueDesc
methodLeakSensor.getStateGet Leak 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, ["normal", "alert"]
data.state.battery<String,Necessary>Level of device's battery, 0 to 4 means empty to full
data.state.interval<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.LeakSensor.setSettings

Set settings for leak sensor

BDDP

ParamValueDesc
methodLeakSensor.setSettingsSet settings for leak sensor
targetDevice<String,Necessary>DeviceId of the device you use;
token<String,Necessary>Net token of the device you use;
params.interval<Number,Optional>Interval (in minutes) for continuous alarm.
params.beep<Boolean,Optional>Weather to enable beep when device alerts
params.sensorMode<String,Optional>Work mode for leak sensor,["WaterPeak":"WaterLeak"]
params.sensitivity<String,Optional>Sensitivity for leak sensor,["low","high"]

BUDP

3.LeakSensor.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
methodLeakSensor.getActivityLogsGet 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.

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.

4.Callbacks

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

BUDP

<Same as 1.LeakSensor.getState>