How to create a virtual sensor

A virtual sensor is a calculated timeseries.

A virtual sensor is a calculated timeseries. You build an expression out of nodes — read in timeseries, apply maths and logic to them — and the result becomes a new timeseries you can use like any other measurement.

Typical uses: summing several meters into one figure, calculating an efficiency, or producing a value that isn't measured directly.

How to create a virtual sensor

  • Go to Virtual sensors in the sidebar.
  • Click New virtual sensor.
  • The Virtual sensor editor opens. Drag node types from the panel onto the canvas — Drag a node type out of this panel to create a new node.
  • Connect the nodes from Input to Output.
  • Click Save.

You get the confirmation Virtual sensor saved. If nothing changed: No changes to save. If it fails: Couldn't save changes.

The node types

Nodes are grouped by what they do:

Group

Examples

Mathematics

Addition, Subtraction, Multiplication, Division, Average, Minimum, Maximum, Absolute value, Power, Root, Natural logarithm, Inverse

Logic

If, If-else, Filter, Upper and lower limit, Schedule

Aggregate

Aggregate datapoints, Aggregate with rolling window, Aggregate forward in time, Historical maximum over calendar period

Advanced

Prediction, Transform, Signal generator, Shift timeseries, Send email, Table

Input comes from Read timeseries or Read several timeseries, and you pick the source with Select timeseries. If none is chosen, it says No timeseries selected.

The Schedule node gives 1 if active, 0 if inactive — used to switch the calculation on and off by operating hours.

Two experimental nodes also exist: AI (experimental), where you write Describe what the node should do, and Python (experimental).

Error handling

Under Error handling you set what happens when input data is missing:

  • Fallback — the value used instead
  • Time period without data before fallback is applied:
  • Time period without data before calculation stops:
Note: The stop period has to be longer than the fallback period — otherwise the message says The time period for emergency stop must be higher than that for fallback. The order is the logic: first the sensor falls back on its fallback value, and only if the data stays missing for long does the calculation stop entirely.

Without error handling, a virtual sensor stops when one of its input series stops reporting.

Execution time window

Execution time window - past and Execution time window - future decide how far the calculation reaches backwards and forwards. Ready-made options are 0, 12 hours, 1 day, 7 days and 30 days, or you enter hours yourself.

Delete existing datapoints before calculating clears the result before recalculating — useful when you've changed the logic and don't want a mix of old and new values.

How to run it and see the result

Use Run in the actions menu, and Outputs to see the result. The description says that Calculation automatically starts again when new data is available — so you only run manually the first time or after a change.

Active shows whether the sensor is running.

How to copy a sensor

Use Make a copy. The copy is called Copy of {name}, and Include timeseries and other settings decides whether the attachments come along.

Frequently asked questions

What's the difference between a virtual sensor and a cloud automation?

A virtual sensor calculates a value. A cloud automation can additionally write to setpoints and so change something in the building. See How to create a cloud automation.

Can I ask about the logic in a sensor I don't understand?

Yes — Ask me about the logic in the virtual sensor lets you ask questions about the setup.

What happens when I delete a sensor?

The warning says it: This will permanently delete the virtual sensor {name} and the accompanying timeseries. Analyses and alarms using the series lose their basis.

Will a sensor email me?

Only if you've added a Send email node. The warning is worth reading: Emails are sent every time the virtual sensor is calculated, except in simulation mode.

Tip!

Set up Error handling before putting the sensor into service, not afterwards. A virtual sensor without a fallback stops silently when an input meter drops out — and everything built on it, from analyses to alarms, stops working with nothing to announce it.