添加门未关超时告警功能,更新状态结构以支持门磁告警和开门时长

This commit is contained in:
Wang Beihong
2026-04-22 19:54:39 +08:00
parent e446b7515c
commit 93bc94a0ee
2 changed files with 46 additions and 1 deletions

View File

@@ -117,6 +117,8 @@
| fire_danger | boolean | true/false | 火焰危险判定 |
| human_present | boolean | true/false | 人体存在状态 |
| door_closed | boolean | true/false | 门磁状态true=关门) |
| door_alarm | boolean | true/false | 门未关超时告警状态 |
| door_open_seconds | number | s | 当前连续开门时长 |
| fan_on | boolean | true/false | 风扇继电器状态 |
| light_on | boolean | true/false | 照明继电器状态 |
| cool_on | boolean | true/false | 制冷继电器状态 |
@@ -207,6 +209,7 @@
- th_temp_l = 15.0
- th_hum_h = 70.0
- th_gas_h = 20.0
- door_open_alarm_seconds = 60
### 7. 下发示例
@@ -239,3 +242,4 @@
- 命令下发后,以上报主题 agri/env/data 的最新数据作为状态确认
- 建议上位机做字段容错:新增字段应忽略,缺失字段使用默认显示
- 当前固件未提供独立 ACK 主题,建议在上位机侧做超时重发策略
- 门磁告警建议以 door_alarm 与 door_open_seconds 组合显示door_alarm=true 时突出提示用户