Files
kkelomatic_home/node-red/room-config-loader.js
nearxos d64d0f8923 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.
2026-02-08 22:30:19 +02:00

25 lines
909 B
JavaScript

// Load room config into global (no require - Function nodes can't use it).
// 1. Open node-red/room-config.js in the repo.
// 2. Copy the whole object: from "const ROOM_CONFIG = {" up to "};" (do NOT copy "module.exports").
// 3. Replace the ROOM_CONFIG below with your paste. Keep the two lines at the end.
const ROOM_CONFIG = {
roomNames: ['cmd_livingroom', 'cmd_out'],
lightEntityMap: [
{ room: 'light_livingRoom', light: 1, entityId: 'input_boolean.living_room_new' },
],
entityToRoom: { living_room_new: 'cmd_livingroom' },
deviceToRoom: { 'Office Switch': 'cmd_livingroom' },
deviceIdToName: {},
switchBindings: {
'Office Switch': {
1: { room: 'cmd_livingroom', light: 1 },
2: { room: 'cmd_livingroom', light: 1 },
},
},
};
global.set('roomConfig', ROOM_CONFIG);
node.warn('[Load room config] loaded: ' + ROOM_CONFIG.roomNames.length + ' rooms');
return null;