[TOC=2]
## 设备告警消息
~~~[api]
get:/installers/device_log/alarm
*string:sn=815518000001#设备序列号
<<<
<<<
success
{
"code": 0,
"data": {
"list": [
{
"warning": 0,
"name": "红外感应器1",
"m": "有人",
"status": 1,
"t": 1665299824,
"IEEE_addr": "2cfe000b5f29",
"zonetype": 13,
"sn": "815518000001"
},
{
"warning": 0,
"name": "红外感应器1",
"m": "有人",
"status": 1,
"t": 1665299824,
"IEEE_addr": "2cfe000b5f29",
"zonetype": 13,
"sn": "815518000001"
}
]
}
}
<<<
error
~~~
## 设备发现
~~~[api]
get:/installers/device_log/recent_log
integer:time=60#多少时间前的变化单位秒
integer:project_id=0#项目 id
integer:group_id=0#分组 id
integer:type=0#设备类型
<<<
<<<
success_project
{
"code": 0,
"data": {
"list": [
{
"sn": "840352001136",
"status": {
"type": 98,
"subtype": 0,
"sw1": false
},
"time": 1649905401,
"time_detail": "2022-04-14 11:03:21",
"label": "04-14 11:03:21",
"device_id": 15417,
"project_id": 86,
"name": "测试设备"
}
]
}
}
<<<
success
{
"code": 0,
"data": {
"list": [
{
"sn": "840354001003",
"status": {
"type": 98,
"subtype": 0,
"sw1": false
},
"time": 1647587828,
"time_detail": "2022-03-18 15:17:08",
"label": "03-18 15:17:08"
}
]
}
}
<<<
explain
sn // 设备序列号
status // 具体变化的自段和值
time // 变化时间
time_detail // 转换后的时间
label // 转换后显示的时间
------ 以下传了筛选参数才会返回 --------
device_id // 对应设备 id
project_id // 对应项目 id
name // 对应设备名称
<<<
error
~~~
## 设备日志
~~~[api]
get:/installers/device_log/list
*string:sn=746814001944#设备序列号
<<<
<<<
success
{
"code": 0,
"data": {
"list": [
{
"time": "2022-03-16 15:51:55",
"label": "03-16 15:51",
"result": "_result",
"table": 0,
"_start": "2022-03-15T16:00:00Z",
"_stop": "2022-03-16T15:59:59Z",
"_time": "2022-03-16T07:51:55Z",
"_measurement": "device_data",
"sn": "746814001944",
"status": {
"is_heat": false,
"type": 86,
"temp": "36.2",
"subtype": 0,
"sw": "112.3"
}
},
]
}
}
<<<
error
~~~