LeakSensor
1.LeakSensor.getState
Get Leak Sensor's State
Param | Value | Desc |
---|---|---|
method | LeakSensor.getState | Get 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 |
Param | Value | Desc |
---|---|---|
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
Param | Value | Desc |
---|---|---|
method | LeakSensor.setSettings | Set 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"] |
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
Param | Value | Desc |
---|---|---|
method | LeakSensor.getActivityLogs | Get 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. |
Param | Value | Desc |
---|---|---|
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
<Same as 1.LeakSensor.getState>