SoilThcSensor
1.SoilThcSensor.getState
Get Soil T&H Sensor's State
| Param | Value | Desc |
|---|---|---|
| method | SoilThcSensor.getState | Get 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.online | <Boolean,Necessary> | Is device online |
| data.state.alarm | <Object,Necessary> | Device alarm settings |
| data.state.alarm.lowTemp | <Boolean,Necessary> | whether a low temperature alarm is active |
| data.state.alarm.highTemp | <Boolean,Necessary> | whether a high temperature alarm is active |
| data.state.alarm.lowHumidity | <Boolean,Necessary> | whether a low humidity alarm is active |
| data.state.alarm.highHumidity | <Boolean,Necessary> | whether a high humidity alarm is active |
| data.state.alarm.lowConductivity | <Boolean,Necessary> | whether a low conductivity alarm is active |
| data.state.alarm.highConductivity | <Boolean,Necessary> | whether a high conductivity alarm is active |
| data.state.alarm.period | <Boolean,Necessary> | the frequency or interval of the alarm |
| data.state.state | <Object,Necessary> | Device current state |
| data.state.state.temperature | <Float,Necessary> | Current temperature |
| data.state.state.humidity | <Float,Necessary> | Current humidity |
| data.state.state.conductivity | <Float,Necessary> | Current conductivity (µS/cm) |
| data.state.attributes | <Object,Necessary> | Device attributes |
| data.state.attributes.alertInterval | <Integer,Necessary> | Interval of Continuous Alert |
| data.state.attributes.reportInterval | <Integer,Necessary> | Interval of repot |
| data.state.attributes.tempLimit.max | <Float,Necessary> | Max temperature range, alert when temperature out of it |
| data.state.attributes.tempLimit.min | <Float,Necessary> | Min temperature range, alert when temperature out of it |
| data.state.attributes.humidityLimit.max | <Float,Necessary> | Max humidity range, alert when humidity out of it |
| data.state.attributes.humidityLimit.min | <Float,Necessary> | Min humidity range, alert when humidity out of it |
| data.state.attributes.conductivityLimit.max | <Float,Necessary> | Max conductivity range, alert when conductivity out of it(µS/cm) |
| data.state.attributes.conductivityLimit.min | <Float,Necessary> | Min conductivity range, alert when conductivity out of it(µS/cm) |
| data.state.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
| data.state.battery | <String,Necessary> | Level of device's battery, 0 to 4 means empty to full |
| data.state.version | <String,Necessary> | Firmware Version of device |
| data.reportAt | <Date,Necessary> | Time of reported |
| data.deviceId | <String,Necessary> | Id of device |
2.SoilThcSensor.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 | SoilThcSensor.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.SoilThcSensor.getMetricsLogs
Used to retrieve device metrics logs through search parameters.
caution
"DEVICE.HISTORICAL_DATA.READ" permission is required to access this interface
| Param | Value | Desc |
|---|---|---|
| method | SoilThcSensor.getMetricsLogs | 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 |
| Param | Value | Desc |
|---|---|---|
| data.logs | <Array,Necessary> | Records of device activity logs |
| data.logs[*].time | <Date,Necessary> | Time of record |
| data.logs[*].* | <number,Necessary> | metrics of record |
4.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.SoilThcSensor.getState>