A Virtual Device produces a new value from readings your project already collects. You define an expression, point its variables at device metrics or fixed constants, and the result becomes something you can chart and alert on like any other metric.
When to build one
Build one when the number your project cares about is not a number any instrument reports directly.
| Situation | Example |
|---|---|
| The instrument reports in the wrong unit | A thermistor arriving in Celsius where the project reports in Fahrenheit |
| A calibration factor has to be applied | A raw reading multiplied by a factor from the instrument's calibration sheet |
| The measurement is a relationship between inputs | The difference between two readings, or one normalised against another |
| The project has its own equation | A site-specific formula from the monitoring plan |
These combine. A single Virtual Device converting a thermistor from Celsius to Fahrenheit and applying its calibration factor in one expression is a typical, useful example.
What it is made of
An expression — the formula, written using your variable names.
Variables — the inputs. Each is either a device metric or a constant. Constants are how calibration factors, conversion coefficients, and fixed offsets enter the calculation without being hard-coded into the expression, which makes them visible and easy to change later.
A primary variable — one device variable is the primary. It determines when the calculation runs and provides the reference timestamp when several inputs have to be lined up in time.
A schedule — it runs when the primary variable reports, optionally after a delay.
An output metric — a metric name and a unit that you declare, which is what every chart and alert threshold downstream reads.
What you can do with the output
Once saved, the calculated value behaves like a device metric. You can plot it on a graph card, set alert thresholds on it, and use it as an input to another Virtual Device, selecting it the same way you select any other metric.
This is what makes Virtual Devices worth building rather than doing the arithmetic elsewhere. The converted, calibrated value is the one people read on the dashboard and the one the alert evaluates, so nobody has to remember to apply the correction themselves.
Name them for the next person
A Virtual Device is someone's engineering assumption made permanent, and six months later the person reading the dashboard will not be the person who built it.
Use a name that says what the value is, and the description to record why the expression is what it is. Where a constant came from a calibration sheet or a project specification, say so. That note is the difference between a colleague trusting the number and quietly rebuilding it.
Comments
0 comments
Article is closed for comments.