Enhance Zigbee to NVL integration with button mapping and configuration updates

- Updated documentation to clarify the mapping of Zigbee buttons to specific (room, light) pairs using `switchBindings`.
- Improved the Zigbee to NVL function to support both single-device and multi-device payloads, enhancing flexibility in handling actions.
- Revised the room configuration to include detailed switch bindings and fallback mechanisms for device identification, streamlining the integration process.

This update improves the usability and functionality of the Zigbee integration within Node-RED, facilitating better control of lighting systems.
This commit is contained in:
2026-02-08 22:30:19 +02:00
parent c049a28c97
commit d64d0f8923
10 changed files with 396 additions and 87 deletions

View File

@@ -0,0 +1,34 @@
# Load room-config.js at Node-RED startup (fix "require is not defined")
Function nodes cannot use `require()`. Load the config in **settings.js** instead.
1. **On the Node-RED server**, edit:
```bash
nano /root/.node-red/settings.js
```
2. **Find** the block that looks like:
```javascript
functionGlobalContext: {
// os:require('os'),
},
```
3. **Add** the room config so it becomes:
```javascript
functionGlobalContext: {
roomConfig: require('/root/.node-red/room-config.js'),
// os:require('os'),
},
```
(Use the correct path to your `room-config.js` if different.)
4. **Save**, then **restart Node-RED**:
```bash
systemctl restart node-red
```
or however you run Node-RED.
5. In your flows, **remove or disconnect** the "Load room config" Function node (or leave it unused). All nodes that use `global.get('roomConfig')` will get the config automatically.
**When you change room-config.js:** upload the file to the server, then restart Node-RED to reload it.