BACnet 写
x/bacnetWrite组件:v0.37.0+ BACnet/IP 写对象属性(analog-output/binary-output/multi-state-value 的 present-value),成功走 Success 链、失败走 Failure 链。
需要额外引入扩展库: rulego-components-iot (opens new window)
# 配置
| 字段 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| server | string | 设备地址 host:port,默认端口 47808 | 127.0.0.1:47808 |
| timeout | int | 请求超时(秒) | 5 |
| priority | int | 写优先级 1-16,0=省略(用设备默认) | 0 |
| points | array | 控制点位表(addr=对象地址,type=值类型,value=写入值) | 见下方 |
# 点位表字段
| 字段 | 说明 | 示例 |
|---|---|---|
| name | 点位名称 | 设定温度 |
| addr | 对象地址:对象类型:实例[:属性] | analog-output:0 |
| type | 值类型:FLOAT32/FLOAT64/BOOL/ENUM/STRING/INT32/UINT16 | FLOAT32 |
| value | 写入值(字符串形式) | 18.5 |
type 决定 BACnet 写入的应用数据类型:
FLOAT32/FLOAT64:analog-output 模拟量输出(real/double)BOOL:binary-output 开关量ENUM:multi-state-value 多态值STRING:字符串属性
各字段支持 ${msg.xx} / ${metadata.xx} 模板。
# 输入/输出
- 输入:
msg.Data带点位列表 JSON[{"addr","type","value"}] - 输出:成功透传消息走
Success链
# 示例
{
"id": "bacnet_write",
"type": "x/bacnetWrite",
"configuration": {
"server": "192.168.1.10:47808",
"timeout": 5,
"priority": 8,
"points": [
{"name": "设定温度", "addr": "analog-output:0", "type": "FLOAT32", "value": "${msg.setpoint}"}
]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
动态写入(msg.Data 带点位列表):
[{"name": "风机", "addr": "binary-output:1", "type": "BOOL", "value": "true"}]
1
# 关联组件
- 读取:x/bacnetRead
- 统一写入入口:x/iotWrite(driver=bacnet)
在 GitHub 上编辑此页 (opens new window)
上次更新: 2026/08/05, 01:52:29