smithtek-nodered-control
v1.0.0
Published
SmithTek Node-RED Control Nodes
Downloads
6
Maintainers
Readme
smithtek-nodered-control
Installation
Install the smithtek-nodered-control
using the NodeRED palette manager
.
Usage
The smithtek-nodered-control
node is designed for controlling pump systems based on tank levels and remote control commands. The node allows for flexible control modes, including local level-based control and remote commands via the global context. It is suitable for use with systems like the SmithTek cloud platform. The node has 2 operation modes "fill" or "Empty"
In the fill mode the start setpoint will be a low value the stop setpoint will be a high value.
In the empty mode the start setpoint will be a high value and the stop setpoint will be a low value.
This works for filling tanks up or emptying tanks or sewage wet water pits.
The control command and setpoint values will come from the smithtek in nodes. The smithtek.cloud will publish the values to the NodeRED runtime. The operator can design the control dashboard to allow sending values. Without this node last known values from smithtek.cloud can annoyingly be published to your PassPort on every deployment or restart.
Setup smithtek-nodered-control
- Drag and drop the node into your Node-RED flow.
- Configure the control mode, start level, stop level, and level key in the node properties.
- Set the appropriate global context values for start and stop levels.
The node operates in two modes:
- Local Control Mode (0): Controls the pump based on tank levels by comparing them to the start and stop levels.
- Remote Start Mode (1): Remotely starts the pump, overriding the local tank levels.
- Remote Stop Mode (2): Remotely stops the pump, overriding the local tank levels.
Configuration Properties
- Control Mode Key: Global context key used to determine the control mode (
0
,1
, or2
). - Start Setpoint Key: Global context key for the start level setpoint (used when filling or emptying the tank).
- Stop Setpoint Key: Global context key for the stop level setpoint.
- Level Key: The key from the incoming message payload that contains the tank level.
- Max Level: The maximum allowable tank level to prevent overfilling or over-emptied tanks.
- Operation Mode: Choose between "fill" (fill the tank) or "empty" (empty the tank).
Control Modes
Local Control (Control Mode 0):
- In this mode, the node monitors the tank level (from
msg.payload.level
) and compares it to the configuredstartLevel
andstopLevel
. - The pump will start when the level is below the
startLevel
and stop when the level exceeds thestopLevel
.
- In this mode, the node monitors the tank level (from
Remote Start (Control Mode 1):
- This mode bypasses local level monitoring and immediately sends a signal to start the pump (
payload: true
).
- This mode bypasses local level monitoring and immediately sends a signal to start the pump (
Remote Stop (Control Mode 2):
- This mode bypasses local level monitoring and immediately sends a signal to stop the pump (
payload: false
).
- This mode bypasses local level monitoring and immediately sends a signal to stop the pump (
Example
[{"id":"4bb597c9fa7b1231","type":"smithtek-control","z":"f6e4dcac415570da","name":"Control Node","controlModeKey":"control","startLevelKey":"start","stopLevelKey":"stop","levelKey":"level","maxLevel":3000,"operationMode":"empty","x":470,"y":440,"wires":[["9b16fb2444aa04f6"]]},{"id":"9b16fb2444aa04f6","type":"debug","z":"f6e4dcac415570da","name":"debug 20","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":440,"wires":[]},{"id":"0aebbab7ec14e698","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":270,"y":560,"wires":[["e643a806a258a861"]]},{"id":"feed64ed2f0e512d","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":270,"y":600,"wires":[["e643a806a258a861"]]},{"id":"3a695937bd7dc934","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":270,"y":640,"wires":[["e643a806a258a861"]]},{"id":"34d04ccce7337b8f","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"150","payloadType":"num","x":270,"y":720,"wires":[["2b1adde1d9e1a8bd"]]},{"id":"69804e5c23f69846","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"101","payloadType":"num","x":270,"y":780,"wires":[["2b6d2bdfc33d06c6"]]},{"id":"c2a7e8dab4b6b65b","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"level":10}","payloadType":"json","x":260,"y":460,"wires":[["4bb597c9fa7b1231"]]},{"id":"a464f742719e8be7","type":"inject","z":"f6e4dcac415570da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{"level":200}","payloadType":"json","x":250,"y":400,"wires":[["4bb597c9fa7b1231"]]},{"id":"e643a806a258a861","type":"smithtek-nodered-control-sp","z":"f6e4dcac415570da","name":"Control Mode","globalKey":"control","x":480,"y":600,"wires":[[]]},{"id":"2b1adde1d9e1a8bd","type":"smithtek-nodered-control-sp","z":"f6e4dcac415570da","name":"start setpoint","globalKey":"start","x":470,"y":720,"wires":[[]]},{"id":"2b6d2bdfc33d06c6","type":"smithtek-nodered-control-sp","z":"f6e4dcac415570da","name":"stop setpoint","globalKey":"stop","x":470,"y":780,"wires":[[]]}]
License
Copyright (c) 2023 www.smithtek.com.au
Licensed under the terms of the GPLv3
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"... [The rest of your license text]
Acknowledgements
Special thanks to:
- Nick O'Leary and Dave Conway-Jones for their invaluable contributions to the Node-Red community.
Contact: [email protected]
Website: www.smithtek.com.au