Variables
A Variable is a typed, named data point. It either comes from a Device (a Device Variable) or is calculated from other Variables (a Virtual Variable). Variables back every Dashboard widget, every Alarm condition, every historical query.
Overview
A Variable has a data type (Number, String, or Boolean), an optional unit, and a logging flag that determines whether history is retained. When logging is on, every value the Variable reports is stored as a timestamped point in the time-series store.
You read Variables through Dashboards, the Platform Explorer, the API, and CSV/JSON export. You write Variables either by publishing from a Device or by defining a Virtual Variable expression.
Device Variables
Device Variables are published by a Device on a configured topic path. They typically represent:
- Sensor readings (temperature, voltage, pressure)
- Device state (running/stopped, mode)
- Diagnostic values (signal strength, error counts)
- Current configuration values
Data type and unit are fixed at configuration time. Changing them later is allowed, but downstream Dashboards and Alarms may need to be re-checked.
Virtual Variables
A Virtual Variable is computed from one or more source Variables using an expression.
To create one:
- Open Variables.
- Click Add Virtual Variable.
- Set name, data type, and optional unit.
- Write the expression and pick the source Variables it references.
- Save.
The expression language supports:
| Category | Operators / functions |
|---|---|
| Arithmetic | +, -, *, / |
| Math | min, max, avg, sum |
| Conditional | if / then / else |
| Time-series | timeShift, movingAverage |
| String | concat, substring |
| Boolean | and, or, not |
Common patterns: aggregating across Devices, converting units, deriving thresholds (a Boolean indicator from a numeric reading), and filtering out invalid values.
Configuration
| Field | Applies to | Notes |
|---|---|---|
| Name | both | Human-readable identifier. |
| Description | both | Optional. |
| Data Type | both | Number, String, Boolean. |
| Unit | numeric | Optional. |
| Topic Path | Device Variables | MQTT topic the Device publishes on. |
| Short ID | both | Optional abbreviated identifier. |
| Logging | both | If true, history is retained. |
| Scaling | numeric | Multiplier and offset applied to incoming values. |
| Validation | numeric | Accepted range. |
| Filtering | numeric | Outlier rejection. |
| Deadband | numeric | Only log changes exceeding the threshold. |
Historical Data
When logging is on, the platform stores time-series points keyed by timestamp. Retention depends on subscription plan.
You can query at two resolutions:
- Raw — every individual value as received.
- Aggregated — bucketed by an interval (1 min, 1 hour, 1 day, etc.) with an aggregation function.
Available aggregation functions: avg, min, max, sum, count, first, last.
Read paths:
- Dashboards — for visual trend exploration.
- Platform Explorer — for interactive ad-hoc analysis.
- Reports — for scheduled or on-demand summaries.
- API — for programmatic access.
- CSV / JSON export — for downstream tools.