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,15 @@
// Paste into the "Clear zigbee edge" Function node (after 80 ms delay).
// Clears zigbee_swN in nvlInState so the PLC sees one pulse. Supports one room or many (switchBindings).
// msg.zigbeeClear can be: { room, key } or [ { room, key }, ... ]
if (msg.zigbeeClear) {
const state = flow.get('nvlInState') || { rooms: {}, boiler: {} };
const list = Array.isArray(msg.zigbeeClear) ? msg.zigbeeClear : [msg.zigbeeClear];
for (const item of list) {
const r = state.rooms[item.room];
if (r && item.key) r[item.key] = false;
}
flow.set('nvlInState', state);
}
msg.payload = { buildAndSend: true };
return msg;