Toggle switch node for Node-RED that stores state and provides ON/OFF/toggle operations without function nodes or flow variables. Version 0.1.1 is current. Configuration supports string, number, or boolean payloads, optional topic filtering, and three pass-through modes: never, on change, or always. Output msg forwards on valid command with state indicated by node status (green/red dot). Compatible with Node-RED 1.x+. Differentiators: no coding required, state persistence across flows, simple visual interface.
npm install node-red-contrib-toggleNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic installation and usage of toggle node with inject nodes.
Ensure msg.topic matches the 'On/Off topic' or 'Toggle topic' if configured, or leave topic fields empty.
Always configure both ON and OFF values if you need both operations.
Check release notes or source history for changes.
Choose pass-through mode based on desired behavior: use 'Always' for immediate feedback, 'If changed' for state change only, 'No' for toggle-only.
cd ~/.node-red && npm install node-red-contrib-toggle
Ensure node is loaded within Node-RED via standard node discovery; do not require() from standalone script.
Restart Node-RED; verify package.json has 'node-red' in 'keywords' or 'node-red' section.