node-red-contrib-smithtek-operator 1.1.0
Smithtek Operator Node for level-based control logic. Supports up to 24 outputs with persistent configuration.
smithtek-nodered-operator
Installation
Install the smithtek-nodered-operator
using the Node-RED Palette Manager, or manually place it into your Node-RED ~/.node-red/nodes
directory and restart Node-RED.
Usage
The smithtek-nodered-operator
node is a powerful control engine designed to work in conjunction with the Operator Config Widget on Smithtek.cloud. It enables real-time control of up to 24 outputs based on level-based logic, digital flags, or other sensor variables—offering a flexible alternative to time-based scheduling.
Unlike the Scheduler Node (which uses fixed time schedules), this Operator Node uses threshold comparisons from incoming JSON payloads to trigger outputs:
- Compare a value against user-defined Start and Stop setpoints
- Choose whether the system is Pumping In or Pumping Out to reverse the logic
- Set the mode for each output:
AUTO
,ON
, orOFF
Each configured output in the Smithtek.cloud widget is mapped to a named key (e.g. tanklevel
, pressure
, input1
, etc.). When a new message arrives containing these keys, the node evaluates the values and executes logic to either activate or deactivate the relevant outputs.
This makes the node ideal for:
- Triggering relays from digital inputs
- General-purpose automation based on high/low thresholds from analog sensors
Setup smithtek-nodered-operator
- Drag the
smithtek-nodered-operator
node into your Node-RED flow - Configure the following:
- Device Token – your secure device API token, located in /devices
- Variable ID – This is the ID for the cloud-stored operator configuration
- Update Frequency – polling rate to retrieve config from the cloud (10 to 60 seconds)
- Site Name – optional label for easy reference in the UI
The configuration is saved locally on the PassPort gateway and will persist after power cycles or network loss. Logic evaluation is handled internally, using the PassPort’s local processing and RTC.
Operator Modes
Each output can be assigned one of three modes:
ON
– Forces the output ON continuouslyOFF
– Disables the output; no messages will be sentAUTO
– Enables threshold-based logic
In AUTO
mode, the logic follows the pattern:
Pumping In
- Start output when value is below start setpoint
- Stop output when value is above stop setpoint
Pumping Out
- Start output when value is above start setpoint
- Stop output when value is below stop setpoint
This allows flexibility for use cases such as tank filling, tank emptying, digital trigger toggling, or any custom level-based application.
Message Output Logic
To conserve bandwidth and avoid unnecessary load on RF or telemetry links, the Operator Node only sends a message when an output changes state.
- If mode is
OFF
– no messages are sent for that output - If mode is
ON
– output remains on and only sends an ON message once - If mode is
AUTO
– output logic is continuously evaluated and updated only when the condition changes
Node Display
The node displays a live summary in the Node-RED editor, showing the current mode and active state for each output (e.g., output3: AUTO (1)
, output7: OFF
).
This helps provide quick visual feedback when editing flows.
Smithtek.cloud Integration
The smithtek-nodered-operator
node connects to Smithtek.cloud only to fetch its configuration—no command logic is stored remotely.
All runtime logic is handled locally using JSON data injected into the input.
To monitor variables such as tank level, digital inputs, or Modbus devices, use the standard smithtek in
nodes in your flow.
The configuration is stored in a single device variable, which keeps data usage low while supporting up to 24 outputs.
You need to use the same device token and variable ID on the cloud widget that you used in the Node-RED node.
Note: The widget uses Variable ID, not the variable name.
Smithtek.cloud Dashboard Usage
Log into your dashboard at www.smithtek.cloud. Use the Operator Configurator Widget to set up logic rules for each output.
Each rule can include:
- Output Name – friendly label (e.g., Pump 1, Zone Valve)
- Setpoint Variable – name of the variable to watch (e.g.,
tanklevel
,input1
) - Start/Stop Setpoints – thresholds to turn the output ON/OFF
- Pumping Direction – choose “Pumping In” or “Pumping Out”
- Mode – ON, OFF, or AUTO
Changes to the configuration will be pulled into the PassPort based on the polling rate set in the node configuration.
All config is also stored locally for operation during network outages.
There is a 24-output LED row at the top of the widget that will change colour depending on the configuration saved:
- 🟢 Green – ON, Active, Healthy
- 🟠 Orange – Auto Mode
- 🔴 Red – Output OFF
This widget allows fast setup and remote updates for your logic — useful for irrigation, tank control, compressor switching, and other automation tasks.
Step-by-step:
Name the Site:
At the top of the widget, enter a friendly name for the overall site (e.g. "Bore Field Control"). This is purely for reference and has no effect on the logic.Enter Your Credentials:
- Device API Token: Paste your Smithtek.cloud device token.
- Variable ID: Paste the ID of the single variable used to store the operator configuration.
These fields may be hidden by default for safety. Click “🔒 Show Advanced” to reveal or edit them.
Add and Configure Operators:
Click➕ Add Operator
to create a new control block.For each operator:
- Output Name: Give the output a clear label (e.g. “Pump 1”, “Valve A”).
- Mode:
ON
: Forces the output ON at all times.OFF
: Disables the output entirely.AUTO
: Enables automatic control based on sensor values.
- Setpoint Variable:
- Enter the name of the incoming variable to compare (e.g.
tanklevel
,input1
).
- Enter the name of the incoming variable to compare (e.g.
- Start Setpoint:
- The level at which the output will turn ON (based on the selected logic direction).
- Stop Setpoint:
- The level at which the output will turn OFF (based on the selected logic direction).
- Direction:
- Choose whether this output is
Pumping In
orPumping Out
.
- Choose whether this output is
Controls:
- Click
➖
to collapse a control block. - Click
🗑️
to delete a control. - You can add up to 24 operator controls in total.
- Click
Saving:
Click💾 Save All
to upload the full configuration to Smithtek.cloud.
The configuration will be stored in a single variable and fetched automatically by the Operator Node in Node-RED.
The Operator Node in Node-RED will fetch this data based on the interval you define in the node configuration (between 10 and 60 seconds). The PassPort will act accordingly even if the network goes offline, thanks to its built-in real-time clock (RTC) and cached operation logic.
Functionality Summary
- Monitors JSON input for named variables
- Compares real-world values against user-defined thresholds
- Supports 24 simultaneous output rules
- Stores config locally for offline operation
- Cloud-based configuration via Smithtek dashboard
- Modes: ON, OFF, AUTO
- Direction logic: Pumping In / Out
- Change-based messaging
- Visual output status in Node-RED editor
- Flexible use for analog or digital input mapping
License
Copyright (c) 2025
www.smithtek.com.au
Licensed under the terms of the GPLv3
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