MotionSensor
1.MotionSensor.getState
Get Motion Sensor's State
Param | Value | Desc |
---|---|---|
method | MotionSensor.getState | Get Motion 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.alertInterval | <Integer,Optional> | Interval of Continuous Alert |
data.state.ledAlarm | <Boolean,Optional> | Is Led blink when motion detected |
data.state.nomotionDelay | <Integer,Optional> | Time to enter No-Motion state |
data.state.version | <String,Necessary> | Firmware Version of device |
data.reportAt | <Date,Necessary> | Time of reported |
data.deviceId | <String,Necessary> | Id of device |
2.MotionSensor.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 | MotionSensor.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. |
3.MotionSensor.setAttributes
Set device's attributes
Param | Value | Desc |
---|---|---|
method | MotionSensor.setAttributes | Set 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.alertInterval | <Integer,Optional> | Alert interval in minutes; |
params.ledAlarm | <Boolean,Optional> | Alarm Led status; |
params.nomotionDelay | <Integer,Optional> | Motion delay in minutes [0-120]; |
params.sensitivity | <Integer,Optional> | Motion detect sensitivity [1-3]; |
Param | Value | Desc |
---|---|---|
params.alertInterval | <Integer,Necessary> | Alert interval in minutes; |
params.ledAlarm | <Boolean,Necessary> | Alarm Led status; |
params.nomotionDelay | <Integer,Necessary> | Motion delay in minutes [0-120]; |
params.sensitivity | <Integer,Necessary> | Motion detect sensitivity [1-3]; |
4.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.MotionSensor.getState>