Introducing calculated properties

By Pilgrim - September 26, 2019

Like a spreadsheet formula, but better

In a spreadsheet, each cell contains either a value or a formula which is based on the value of other cells:


 

A

B

C

D

E

1

Q1

Q2

Q3

Q4

TOTAL

2

1000

2000

3000

4000

=SUM(A2:D2)

Formulas are really useful for:

  • Consistency: Whenever input data changes, everything dependent on that data updates automatically. The same happens if the formula was initially wrong and you correct it - all dependent data updates.
  • Simplicity: Formulas turn the spreadsheet into a tool which can be used by people who don’t have to understand the details of how the calculations work - they can just put in new values and get the correct answer.
  • Convenience: Formulas can be re-used, saving time and effort

DevicePilot’s recent release of Calculated Properties (CPs) delivers the power of formulas to the world of streaming data - with some special features which make them even more powerful. Of course, the difference between DevicePilot and a spreadsheet is that the data is constantly streaming in live and there might be millions of historical values per device.

Calculated Properties

To define a Calculated Property go to the top of the Settings/Properties page and hit "Create New" next to Calculated Properties.

CP menu

You give a name and an expression in terms of other properties of the device and then the CP behaves just like a 'real' property of the device - you can use it everywhere you see or define a property in DevicePilot, adding analytical power at the beginning of the pipeline and improving the Consistency, Simplicity and Convenience of your solution.

Calculated Properties can be used to do unit conversion, merge and explode properties, extract and manipulate strings, all on-the-fly ... and perhaps their more powerful feature comes from the fact that they can see the previous state of each property too (and the current and previous timestamp). This allows them to do some very neat things such as integrating power into energy, and turning changes in lat/lon co-ordinates into distance moved over the surface of the Earth.

Explore the full power of DevicePilot Calculated Properties.

magnus in a circle in a rectangle 2x

Want to see more great IoT content?

Sign up to our (spam-free!) newsletter for industry news, updates, and advice on how to get the most out of your project:

Comments

We promise that we won't SPAM you.