// Load room config into global (no require - Function nodes can't use it). // 1. Open node-red/config_files/room-config.js in the repo (mirror of server file). // 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: [ 'open_plan_living_room', 'open_plan_dining_room', 'open_plan_entrance', 'open_plan_guest_wc', 'kitchen_kitchen', 'kitchen_pantry', 'bedrooms_office', 'bedrooms_hallway', 'bedrooms_laundry', 'bedrooms_shower', 'bedrooms_bedroom', 'master_bedroom_suite', 'master_bedroom_bathroom', 'exterior_veranda', 'exterior_entrance', 'exterior_yard', ], lightEntityMap: [ { room: 'l_open_plan_living_room', light: 1, entityId: 'input_boolean.open_plan_living_room_main_1' }, ], entityToRoom: { open_plan_living_room_main: 'open_plan_living_room' }, deviceToRoom: { 'Office Switch': 'open_plan_living_room' }, deviceIdToName: {}, switchBindings: { 'Office Switch': { 1: { room: 'open_plan_living_room', light: 1 }, 2: { room: 'open_plan_dining_room', light: 1 }, }, }, }; global.set('roomConfig', ROOM_CONFIG); node.warn('[Load room config] loaded: ' + ROOM_CONFIG.roomNames.length + ' rooms'); return null;