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:
15
docs/integration/clear-zigbee-edge.js
Normal file
15
docs/integration/clear-zigbee-edge.js
Normal 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;
|
||||
Reference in New Issue
Block a user