Flow Variables

Variables are the data layer of your flows. They store values that blocks can read, write, and compare — connecting sensor readings to decisions and actuator actions.


Local vs Global Variables

Local Variables

PropertyDescription
ScopeThis flow only
ID Prefixvar_1, var_2, …
LifetimeCreated when the flow starts, deleted when it ends
PurposeTemporary storage for intermediate values during flow execution

Use local variables for:

  • Storing a sensor reading to compare it later in the same flow
  • Holding a calculated dosing amount
  • Temporary counters or flags

Global Variables

PropertyDescription
ScopeShared across flows and programs
ID Prefixglobal_1, global_2, …
LifetimePersist between flow executions
PurposeTarget values, thresholds, and shared data that programs can override
FieldsName, Unit, Description, Default Value, Tolerance

Use global variables for:

  • Target setpoints (e.g., target_ph = 6.5, target_ec = 1.8)
  • Thresholds that programs can override per schedule
  • Values that need to survive between flow runs

The Key Difference: Overrides

Global variables can be overridden by Programs. When a Program loads a flow, it can set custom values for global variables per time window. This is what makes flows reusable.

How it works:

  1. You create a flow with global variable target_ec (default: 1.5)
  2. A Program includes this flow in two time windows:
    • Morning → target_ec overridden to 1.8
    • Night → target_ec overridden to 1.2
  3. The flow is identical, but the behavior changes based on the schedule

Local variables cannot be overridden — they always start with their default value (or undefined) each time the flow runs.


Opening the Variable Manager

Click the Variables button in the editor toolbar. The manager opens as a dialog with two tabs:

TabShows
Local (count)All local variables for this flow
Global (count)All global variables for this flow

Creating a Variable

Adding a Local Variable

  1. Switch to the Local tab
  2. Click + Add Local
  3. The edit dialog opens with a generated ID (var_1)
  4. Fill in:
FieldRequiredDescription
Name✅Human-readable name (e.g., “Current pH”)
Unit✅The measurement unit — must be selected from the unit picker

Adding a Global Variable

  1. Switch to the Global tab
  2. Click + Add Global
  3. Fill in:
FieldRequiredDescription
Name✅Human-readable name (e.g., “Target pH”)
Unit✅The measurement unit
Enable Tolerance❌Whether this variable has tolerance (±) settings
Description❌Explains what this variable represents
Default Value❌The starting value if no Program override is set
Default Tolerance❌The range around the value that’s considered acceptable

Tolerance

Tolerance defines what counts as “close enough” to the target value:

ModeSymbolMeaningExample (value=6.5, tolerance=0.2)
Symmetric±Both directionsAcceptable: 6.3 – 6.7
Positive+Only aboveAcceptable: 6.5 – 6.7
Negative-Only belowAcceptable: 6.3 – 6.5

How Variables Are Referenced in Blocks

When a block field supports variables, a Var toggle button appears next to the input:

ModeInput
Fixed valueRegular number/text input
VariableVariable selector dropdown — choose from all flow variables

When a variable is selected, it’s stored as {{variable_id}} (e.g., {{global_1}}). The engine resolves this to the actual value at runtime.

Which blocks write variables?

BlockWhen
Sensor ReadWrites the sensor value to the selected target variable

Which blocks read variables?

BlockFields That Can Use Variables
Actuator SetDuration, Amount (dosing)
IF (Condition)Variable to check, Comparison value
LoopIteration count, Timeout, Interval, Stop condition
WaitDuration

Flow Health Dashboard — Variable Analysis

When no block is selected, the Properties Panel shows the Flow Health Dashboard, which includes a Variable Matrix. It flags issues:

BadgeColorMeaning
UnusedRedVariable exists but no block reads or writes it
Write OnlyYellowA block writes to it, but nothing reads it
Read OnlyOrangeA block reads it, but nothing writes to it

Unit Conversion

Values are stored internally in base units (e.g., Celsius for temperature, milliliters for volume). When you enter or view values, the system automatically converts between the display unit and the base unit.


Best Practices

  1. Name descriptively — target_ph is better than var_1.
  2. Use globals for targets — anything a Program might want to change should be global.
  3. Use locals for readings — sensor values only needed during one flow run should be local.
  4. Always set default values for globals — if no Program override exists, the flow needs a fallback.
  5. Enable tolerance for setpoints — defines what “close enough” means for comparisons.
  6. Check the Health Dashboard — look for unused and write-only variables.
  7. Match units carefully — mismatched units trigger validation errors.

Troubleshooting

“Save” button disabled in edit dialog

  • A unit must be selected. Click the unit picker and choose one.

Variable not showing in block selector

  • Make sure the variable has been saved. Close the Variable Manager and reopen the block properties.

Red “unit mismatch” error on Sensor Read block

  • The sensor’s output unit doesn’t match the target variable’s unit.

“Unused” badge on a variable

  • No block reads or writes it. Either connect it to a block or delete it.

“Read Only” badge

  • A block tries to read this variable, but nothing writes to it. Add a Sensor Read block that writes to this variable, or set a default value.