Skip to main content

THSensor

1.THSensor.getState

Get T&H Sensor's State

BDDP

ParamValueDesc
methodTHSensor.getStateGet T&H 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.temperature<Float,Necessary>Current temperature
data.state.humidity<Float,Necessary>Current humidity
data.state.tempLimit<Object,Necessary>Normal temperature range, alert when temperature out of it
data.state.humidityLimit<Float,Necessary>Normal humidity range, alert when humidity out of it
data.state.tempCorrection<Float,Necessary>Calibration of temperature
data.state.humidityCorrection<Float,Necessary>Calibration of humidity
data.state.version<String,Necessary>Firmware Version of device
data.reportAt<Date,Necessary>Time of reported
data.deviceId<String,Necessary>Id of device

2.THSensor.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
methodTHSensor.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.

3.THSensor.getMetricsLogs

Used to retrieve device metrics logs through search parameters.

caution

"DEVICE.HISTORICAL_DATA.READ" permission is required to access this interface

BDDP

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

BUDP

ParamValueDesc
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

BUDP

<Same as 1.THSensor.getState>