[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
~~~