- 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.
1.0 KiB
1.0 KiB
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.
-
On the Node-RED server, edit:
nano /root/.node-red/settings.js -
Find the block that looks like:
functionGlobalContext: { // os:require('os'), }, -
Add the room config so it becomes:
functionGlobalContext: { roomConfig: require('/root/.node-red/room-config.js'), // os:require('os'), },(Use the correct path to your
room-config.jsif different.) -
Save, then restart Node-RED:
systemctl restart node-redor however you run Node-RED.
-
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.