node-red-contrib-rpo-toggle
v1.0.4
Published
Toggle flip-flop - converts push button to switch (boolean output on every truthy input)
Maintainers
Readme
node-red-contrib-toggle
A Node-RED node that toggles a boolean output on every truthy input. Acts like a push button converting to a latching switch.
Installation
npm install node-red-contrib-toggleInputs
- payload
any: Truthy toggles output; falsy silently ignored. - set (optional)
boolean: Force output to specific value without toggling. - reset (optional)
boolean: Reset to initial state.
Outputs
- payload
boolean: Current state: true or false. - toggle
object: { state, previous, toggleCount }
Configuration
- Initial State: State on deploy/restart (default: OFF).
- Persistent: Retain state across Node-RED restarts via context filesystem store.
Tips
- Send any truthy value (1, true, "on") to toggle.
- Use msg.set = true/false to force a specific state.
- Use msg.reset = true to return to the initial state.
License
MIT (c) sr.rpo
