Hoppa till huvudinnehåll

Lesson 2.2 Calculations

Calculations refer to different calculations to apply between devices. A calculation creates a virtual node that holds the result of the calculation. The data used by the device does not go back in time; instead, it uses data from after the calculation was created. In the device details of the calculated device, you can see which devices are included, what value was used, and the type of calculation. It is one of the most powerful features of the platform and can be used to realize a wide variety of use cases.

Calculate Calculate

In this lesson, we will explore the available calculation types and learn how each one affects data processing and visualization.

Available Calculations

There are two types, and the type decides what is compared:

  • Last value based compares the latest value from each selected device against the others, and gives you one calculated device for the whole selection. The methods are Mean, Min, Max, First, Last, Count, Sum and Difference.
  • Window based compares one device's own consecutive values over a moving window, and gives you one calculated device per selected device. The methods are Difference and Derivative.

Each method is described in Calculations in the user guide.

Create calculated nodes

A calculated node is a device that takes a specific value, performs a calculation on the data, and then presents the result as a device. Let's try it out.

  1. Press "Select Many".
  2. Select devices to add to the calculation.
  3. Press "Select Action" and then "Calculate".
  4. Choose a type, then a calculation.
  5. Pick a "Measurement" for your devices.
  6. Select a name for your calculated device.
  7. Press "Create".

The full walkthrough, including the window settings and what to expect afterwards, is Create a calculation.

  • Repeat this process for different types of IoT nodes and measurements, and add alarm translators to the calculated node. This allows you to monitor conditions such as whether the average temperature in a building is too high or too low.
  • Add calculated nodes to your views and dashboards to enable clear and insightful visualizations.
  • Using the Swagger API, you can also direct multiple calculations to the same IoT node.

⚠️ Important:
For cases involving conditional logic, filtering, or custom thresholds, use a data flow or translator instead of calculated nodes.

If you need to perform calculations across a large number of devices, a translator is also the preferred option.
The translator feature "Additional Device Update" offers superior scalability compared to calculated nodes, as it operates on incoming events only rather than on stored time series data.

Example use cases

The calculated-node use cases, both the everyday ones and the specialized ones, are collected in the user guide: Calculations. Go through a few of them that match your own installation.