Overview
Variables are InfluxDB metrics that serve as the foundation for dashboards and alarm systems in Mas Agua. Each variable can be:- Simple: Direct data from a single InfluxDB topic/field
- Calculated: Derived from mathematical formulas combining multiple variables
- Binary Compressed: Multiple boolean states packed into a single byte
Accessing Variables
Navigate to Configuration > Variables to manage your InfluxDB variables.Variable Types
Instantaneous Variables
Capture the latest value from InfluxDB:Historical Variables
Store historical data over time:Creating a Variable
Configure Basic Properties
Variable name (e.g., “Pump 1 Pressure”)
Process category for filtering (e.g., “Water Treatment”, “Distribution”)
Unit of measurement (e.g., “bar”, “°C”, “m³/h”)
Variable type:
last- Instantaneous (latest value)history- Historical (time series data)
Configure Data Source
For simple variables:
InfluxDB topic (measurement name)
Field name within the topic
Query time window (e.g., 5, 60, 3600)
Time unit:
ms- Millisecondss- Secondsm- Minutesh- Hoursd- Daysmo- Monthsy- Years
Sampling period value
Period time unit (same options as
unit_topic)Aggregation method:
last- Latest valuemean- Average value
Calculated Variables
Calculated variables combine multiple data sources using mathematical formulas.Enabling Calculation Mode
- Toggle “¿La variable requiere un calculo?” switch
- The form switches to formula builder mode
- Define variables used in the formula
- Build the mathematical expression
Formula Builder
The calculator interface supports:- Operators:
+,-,*,/,(,) - Variables: Reference other configured variables
- Numbers: Constants in your formula
Example: Power Calculation
Binary Compressed Variables
Pack up to 8 boolean states into a single byte value.Configuration
- Toggle “¿Variable binaria comprimida?” switch
- Click Agregar bit to add bit assignments (max 8)
- For each bit:
- Nombre: Descriptive name (e.g., “Pump Running”)
- Posición: Bit position (0-7)
Example: Equipment Status
Binary compressed variables cannot use calculation mode simultaneously.
Filtering Variables
Use the filter panel to find variables:Filter by unit of measurement
Filter by calculation status:
- All variables
- Only calculated (
true) - Only direct (
false)
Filter by process category
Managing Variables
Edit Variable
- Click Editar in the table row
- Modify configuration
- Click Guardar variable
Delete Variable
- Click Eliminar in the table row
- Confirm deletion in the dialog
API Endpoints
Variables are managed through these backend routes:| Endpoint | Method | Purpose |
|---|---|---|
/saveVariable | POST | Create or update variable |
/deleteVar/:id | POST | Delete variable by ID |
/getVarsInflux | GET | Retrieve all variables |
Data Structure
The complete variable schema:See Also
- Alarms - Use variables to trigger alerts
- PLC Profiles - Connect variables to PLC data sources
- Dashboards - Visualize variable data

