The PumpControl component is a specialized monitoring panel designed specifically for water treatment plant pump stations. It displays pump status, system states, and operational metrics with dedicated sections for different equipment types.
Overview
PumpControl provides a comprehensive view of pump station operations with:
Pump monitoring section - Track individual pump status and runtime
System state indicators - Monitor valves, levels, and other binary states
Real-time data integration - Automatic updates from InfluxDB variables
Configurable layout - Add/remove pumps and states dynamically
Visual status indication - Color-coded states for quick assessment
This component combines elements of boolean indicators, numeric displays, and timing information in a specialized layout optimized for pump station operators.
Props
Enables edit mode for configuration. Set to false for display-only mode on the dashboard.
Array of pump configurations. Each pump object should contain: Show Pump object properties
Unique identifier for the pump
Display name (e.g., “Pump 1”, “Backup Pump”)
InfluxDB variable ID for pump status
Current value from InfluxDB (updated automatically)
Unit of measurement (if applicable)
Array of system state configurations (valves, sensors, etc.) Show State object properties
Unique identifier for the state
Display name (e.g., “Inlet Valve”, “High Level Alarm”)
InfluxDB variable ID for state value
Current value from InfluxDB (updated automatically)
Unit of measurement (if applicable)
Title displayed at the top of the pump control panel
Configuration Mode
When edit={true}, the component provides a configuration interface:
Adding Pumps
Click Add Pump
Opens a dialog for configuring a new pump
Enter pump details
Name : Descriptive name for the pump
Variable : Select the InfluxDB variable to monitor
Save configuration
Pump is added to the monitoring panel
Adding States
Click Add State
Opens a dialog for configuring a system state indicator
Enter state details
Name : Descriptive name (e.g., “Inlet Valve Open”)
Variable : Select the boolean InfluxDB variable
Save configuration
State indicator is added to the panel
Saving to Backend
The configuration is saved via the API:
// From ~/workspace/source/src/modules/Charts/views/ConfigBombs.jsx:99
const url = ` ${ backend [ import . meta . env . VITE_APP_NAME ] } /bombs`
Request body structure:
{
"title" : "Main Pump Station" ,
"pumps" : [
{ "id" : 1 , "name" : "Pump 1" , "varId" : 123 , "type" : "pump" }
],
"states" : [
{ "id" : 1 , "name" : "Inlet Valve" , "varId" : 456 , "type" : "status" }
]
}
Display Mode
When edit={false} (dashboard display mode), the component shows:
Pump Section
Visual pump status indicators
Runtime or flow rate values
Color-coded active/inactive states
Historical data if available
State Section
LED-style boolean indicators
Current state values
Clear on/off or open/closed indication
Usage Example
import PumpControl from './components/Charts/views/ConfigBombs'
// Configuration mode (in settings)
< PumpControl
edit = { true }
initialPumps = { [] }
initialStates = { [] }
initialTitle = "Configure Pump Station"
/>
// Display mode (on dashboard)
< PumpControl
edit = { false }
initialPumps = { [
{
id: 1 ,
name: "Primary Pump" ,
varId: 101 ,
value: 1 , // 1 = running, 0 = stopped
unit: null ,
type: "pump"
},
{
id: 2 ,
name: "Secondary Pump" ,
varId: 102 ,
value: 0 ,
unit: null ,
type: "pump"
}
] }
initialStates = { [
{
id: 1 ,
name: "Inlet Valve Open" ,
varId: 201 ,
value: 1 , // Boolean: 1 = open, 0 = closed
unit: null ,
type: "status"
},
{
id: 2 ,
name: "High Level Alarm" ,
varId: 202 ,
value: 0 ,
unit: null ,
type: "status"
}
] }
initialTitle = "Pump Station A"
/>
Real-World Use Cases
Main Pump Station
Booster Station
Treatment Plant
Monitor primary water supply pumps: < PumpControl
edit = { false }
initialTitle = "Main Water Supply"
initialPumps = { [
{ id: 1 , name: "Pump 1 - 50HP" , varId: 101 , value: 1 , type: "pump" },
{ id: 2 , name: "Pump 2 - 50HP" , varId: 102 , value: 1 , type: "pump" },
{ id: 3 , name: "Pump 3 - 75HP" , varId: 103 , value: 0 , type: "pump" }
] }
initialStates = { [
{ id: 1 , name: "Suction Pressure OK" , varId: 201 , value: 1 , type: "status" },
{ id: 2 , name: "Discharge Valve Open" , varId: 202 , value: 1 , type: "status" },
{ id: 3 , name: "Emergency Stop" , varId: 203 , value: 0 , type: "status" }
] }
/>
Track booster pumps and pressure zones: < PumpControl
edit = { false }
initialTitle = "Booster Station - Zone 3"
initialPumps = { [
{ id: 1 , name: "Booster 1" , varId: 301 , value: 1 , type: "pump" },
{ id: 2 , name: "Booster 2" , varId: 302 , value: 0 , type: "pump" }
] }
initialStates = { [
{ id: 1 , name: "Zone Pressure OK" , varId: 401 , value: 1 , type: "status" },
{ id: 2 , name: "Auto Mode Active" , varId: 402 , value: 1 , type: "status" },
{ id: 3 , name: "VFD Fault" , varId: 403 , value: 0 , type: "status" }
] }
/>
Monitor treatment process pumps: < PumpControl
edit = { false }
initialTitle = "Chemical Dosing System"
initialPumps = { [
{ id: 1 , name: "Chlorine Pump" , varId: 501 , value: 1 , type: "pump" },
{ id: 2 , name: "Coagulant Pump" , varId: 502 , value: 1 , type: "pump" },
{ id: 3 , name: "pH Adjustment" , varId: 503 , value: 1 , type: "pump" }
] }
initialStates = { [
{ id: 1 , name: "Tank 1 Level OK" , varId: 601 , value: 1 , type: "status" },
{ id: 2 , name: "Tank 2 Level OK" , varId: 602 , value: 1 , type: "status" },
{ id: 3 , name: "Flow Rate Normal" , varId: 603 , value: 1 , type: "status" }
] }
/>
Integration with Dashboard
PumpControl is registered in the Home dashboard chart components:
// From ~/workspace/source/src/modules/home/views/index.jsx:17-26
const chartComponents = {
LiquidFillPorcentaje ,
CirclePorcentaje ,
BarDataSet ,
PieChart: DoughnutChart ,
PumpControl , // ← Available for dashboard widgets
GaugeSpeed ,
BooleanChart ,
MultipleBooleanChart
}
Data is automatically fetched and updated every 30 seconds via the multipleDataInflux API endpoint.
API Integration
Save Configuration
Request body:
{
"title" : "string" ,
"pumps" : [
{
"id" : "number" ,
"name" : "string" ,
"varId" : "number" ,
"type" : "pump"
}
],
"states" : [
{
"id" : "number" ,
"name" : "string" ,
"varId" : "number" ,
"type" : "status"
}
]
}
Fetch Data
Data is fetched through the standard multipleDataInflux endpoint used by the dashboard, which queries all configured InfluxDB variables and returns their current values.
Validation
Before saving, the component validates:
At least one pump OR one state must be configured
Each item must have a valid InfluxDB variable selected
Names cannot be empty
Configuration Dialog
The add pump/state dialog includes:
Text field for name input
Variable selector component (uses SelectVars component)
Type indicator (automatically set based on dialog type)
Save/Cancel buttons
Best Practices
Organize by function : Group pumps that work together (parallel pumps, duty/standby pairs) in the same PumpControl panel.
Include critical states : Always include essential status indicators like emergency stop, pressure alarms, and valve positions alongside pump statuses.
Variable naming : Use clear, descriptive variable names in InfluxDB that match physical equipment labels for easier configuration.