本接口为采样器状态查询接口。
通过调用此接口查询采样器最新状态
post /api/equips/{equipId}/samplerInfo HTTP/1.1
Host: dev.thuwater.com
X-TH-TOKEN: 26b0e5bfcbc.214ce96c1f7c9f0a33549b81087579b38b6a8.e9ba17523a25d766
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://dev.thuwater.com/api/equips/{equipId}/samplerInfo',
'headers': {
'X-TH-TOKEN': 'eyJhbGciOiJIUzM4NCJ9.LGTdU3zv-XdOc57Dug2USwzmwAd9kJj3SnRzQDT76A_2CzlZ52T3G9q6CVlhz8D8'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://dev.thuwater.com/api/equips/{equipId}/samplerInfo")
.method("GET", null)
.addHeader("X-TH-TOKEN", "eyJhbGciOiJIUzM4NCJ9.LGTdU3zv-XdOc57Dug2USwzmwAd9kJj3SnRzQDT76A_2CzlZ52T3G9q6CVlhz8D8")
.build();
Response response = client.newCall(request).execute();
参数名称 | 必填 | 说明 |
---|---|---|
X-TH-TOKEN | 是 | 通过登陆接口获取的token |
equipId | 是 | 设备ID 放入请求路径 |
HTTP/1.1 200 OK
Content-Type: application/json
{
"comFlag": "成功",
"comTime": "2022-02-22 17:45:00",
"samplerMissionstate": "任务待命中",
"samplerCurrentTemp": 9.1,
"samplerBattery": 10.6,
"replyBattery": 4.144,
"samplerFlowCount": 77,
"sampleTemp": [
10.5,
-50.0,
-50.0,
-50.0
],
"sampleTime": [
"2022-01-14 11:41:00",
"2014-01-01 00:00:00",
"2014-01-01 00:00:00",
"2014-01-01 00:00:00"
],
"samId": 1111111
}
参数名称 | 说明 |
---|---|
httpcode | 200-正常,401-无权限,500-其他错误。 |
comFlag | 中继器与采样计通信状态 |
comTime | 最后通信时间 |
samplerMissionstate | 任务标志 |
samplerCurrentTemp | 当前温度(℃) |
samplerBattery | 采样器电池电压(V) |
replyBattery | 中继器电池电量(V) |
samplerFlowCount | 管道通畅度 |
sampleTemp | 采样温度,每个样瓶的采样温度,当为-50的时候说明不存在 |
sampleTime | 每个样瓶的最后采样时间,2014-01-01 00:00:00表示采样时间不存在 |
samId | 设备id |