impress_sig_mesh_hacs/参数配置表.md
impressionyang 6a66c9b474 初始提交:SigMesh Gateway HACS 集成
项目结构:
- custom_components/sigmesh_gateway/ - Home Assistant 集成
  - serial_reader.py - 串口读取器
  - protocol_parser.py - 协议解析器
  - coordinator.py - 数据协调器
  - platforms/ - 传感器/开关/灯光/设备追踪实体

文档:
- PRD.md - 产品需求文档
- README.md - 用户使用指南
- 可行性分析.md - 技术可行性分析
- 参数配置表.md - 配置参数记录
- 调试检查清单.md - 问题排查指南

功能特性:
- 串口通信 (115200 波特率)
- Bluetooth Mesh 协议解析
- 支持 200+ 设备接入
- UI 配置界面
- 多平台实体支持

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 18:20:48 +08:00

156 lines
4.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# SigMesh Gateway - 参数配置表
**用途**: 用于快速调整和记录配置参数
---
## 1. 串口参数
| 参数名 | 配置键 | 默认值 | 可调范围 | 当前值 | 说明 |
|--------|--------|--------|----------|--------|------|
| 设备路径 | `serial_device` | `/dev/ttyUSB0` | 系统决定 | ______ | 串口设备路径 |
| 波特率 | `baudrate` | `115200` | 9600-921600 | ______ | 串口通信速率 |
| 数据位 | `bytesize` | `8` | 5-8 | ______ | 通常为 8 |
| 停止位 | `stopbits` | `1` | 1, 1.5, 2 | ______ | 通常为 1 |
| 校验位 | `parity` | `N` | N/E/O/M/S | ______ | N=无校验 |
| 超时 | `timeout` | `0.1` | 0.01-10s | ______ | 读取超时 (秒) |
**常见串口路径**:
- Linux: `/dev/ttyUSB0`, `/dev/ttyUSB1`, `/dev/ttyACM0`
- Windows: `COM3`, `COM4`
- macOS: `/dev/cu.usbserial-*`
---
## 2. 协调器参数
| 参数名 | 配置键 | 默认值 | 可调范围 | 当前值 | 说明 |
|--------|--------|--------|----------|--------|------|
| 轮询间隔 | `poll_interval` | `30` | 5-3600s | ______ | 定时刷新间隔 |
| 防抖冷却 | `debounce_cooldown` | `1` | 0.1-10s | ______ | 事件防抖间隔 |
| 更新超时 | `update_timeout` | `10` | 5-60s | ______ | 更新超时限制 |
| 重连间隔 | `reconnect_interval` | `5` | 1-60s | ______ | 断线重连间隔 |
| 重连次数 | `reconnect_attempts` | `3` | 1-10 | ______ | 最大重连次数 |
---
## 3. 协议参数
| 参数名 | 默认值 | 说明 | 调整建议 |
|--------|--------|------|----------|
| 事件前缀 | `+EVENT=` | 串口消息前缀 | 根据网关固件调整 |
| 行结束符 | `\r\n` | 行分隔符 | 通常为`\r\n`或`\n` |
| Mesh 前缀 | `+EVENT=MESH,recv` | Mesh 消息标识 | - |
| 配网前缀 | `+EVENT=PROV` | 配网事件标识 | - |
---
## 4. 实体参数
### 4.1 传感器
| Property ID | 名称 | 单位 | 缩放因子 | 启用状态 |
|-------------|------|------|----------|----------|
| 0x0050 | PRESENCE_DETECTED | 布尔 | ×1 | □ |
| 0x0051 | MOTION_DETECTED | 布尔 | ×1 | □ |
| 0x0059 | AMBIENT_TEMPERATURE | °C | ÷100 | □ |
| 0x005A | AMBIENT_HUMIDITY | % | ÷100 | □ |
| 0x005D | LIGHT_INTENSITY | lx | ×1 | □ |
| 0x0075 | BATTERY_LEVEL | % | ×1 | □ |
| 0x0092 | CO2_CONCENTRATION | ppm | ×1 | □ |
| 0x00B4 | PM2_5_CONCENTRATION | μg/m³ | ×1 | □ |
| 0x00B9 | TVOC_CONCENTRATION | ppb | ×1 | □ |
### 4.2 模型 ID 映射
| 模型 ID | 名称 | 实体类型 | 启用状态 |
|---------|------|----------|----------|
| 0x1000 | OnOff Server | Switch/Binary Sensor | □ |
| 0x1300 | Light Lightness | Light | □ |
| 0x1307 | HSL | Light | □ |
| 0x130C | Color | Light | □ |
| 0x130D | CTL | Light | □ |
| 0x1100 | Sensor Server | Sensor | □ |
---
## 5. 日志级别配置
| 模块 | 推荐级别 | 当前配置 |
|------|----------|----------|
| `custom_components.sigmesh_gateway` | INFO | ______ |
| `custom_components.sigmesh_gateway.serial_reader` | DEBUG | ______ |
| `custom_components.sigmesh_gateway.protocol_parser` | DEBUG | ______ |
| `custom_components.sigmesh_gateway.coordinator` | INFO | ______ |
**日志级别**: `DEBUG` < `INFO` < `WARNING` < `ERROR` < `CRITICAL`
---
## 6. 性能参数
| 参数 | 默认值 | 最小值 | 最大值 | 当前值 |
|------|--------|--------|--------|--------|
| 最大设备数 | 200 | 1 | 500 | ______ |
| 消息队列大小 | 100 | 10 | 1000 | ______ |
| 读取间隔 (ms) | 10 | 1 | 100 | ______ |
| 内存限制 (MB) | 50 | 10 | 200 | ______ |
---
## 7. 调试开关
| 开关名 | 默认值 | 说明 | 当前状态 |
|--------|--------|------|----------|
| 原始数据打印 | `False` | 打印原始串口数据 | |
| 解析详情打印 | `False` | 打印解析中间结果 | |
| 时间戳记录 | `True` | 记录消息时间戳 | |
| 性能统计 | `False` | 统计处理延迟 | |
---
## 8. 配置变更记录
| 日期 | 参数名 | 旧值 | 新值 | 原因 | 效果 |
|------|--------|------|------|------|------|
| ______ | ______ | ______ | ______ | ______ | ______ |
| ______ | ______ | ______ | ______ | ______ | ______ |
| ______ | ______ | ______ | ______ | ______ | ______ |
---
## 9. 快速配置模板
### 9.1 标准配置
```yaml
serial_device: /dev/ttyUSB0
baudrate: 115200
poll_interval: 30
```
### 9.2 调试配置
```yaml
serial_device: /dev/ttyUSB0
baudrate: 115200
poll_interval: 10
logger: debug
```
### 9.3 高性能配置
```yaml
serial_device: /dev/ttyUSB0
baudrate: 921600
poll_interval: 5
debounce_cooldown: 0.5
```
---
## 10. 故障排查记录
| 日期 | 问题描述 | 排查步骤 | 解决方案 | 状态 |
|------|----------|----------|----------|------|
| ______ | ______ | ______ | ______ | |
| ______ | ______ | ______ | ______ | |
| ______ | ______ | ______ | ______ | |