Skip to content

Expressions

In a similar way to the scaling properties on tags, expressions are calculations that are applied to a tag value when the values are logged. Since expressions are applied to tags, you can either create a new tag if you want to store both the calculated and the original data. Or add it to an existing tag if you don't want to store the raw data.

Creating an expression

Note that you need be in edit mode to edit tags, so open the edit menu if you haven't already

Go to the tag list and toggle show advanced:

img

You will find two new columns:

img

Expression is clicked to open up the expression editor. Using the expression editor you can build calculations by drag-dropping blocks and entering values in the expression canvas.

Expressionable means that this tag can be used in calculations with other tags. This means that if tags are expressionable you can select them here:

img

Examples

Here are a few examples of expressions.

Sum of two tags

img

Counter

Note that this expression will be evaluated approximately once every poll interval on the expression tag. But the timing is not guaranteed, so with a poll interval of 1 second, the value may not be exactly 3600 after one hour. So this technique may not be useful for a timer, but it can often be combined with other features. For example adding a small delay before a certain vaule is set based on some condition.

img

IsRunning based on power consumption

Note if/else conditions can be modified by clicking the settings button:

img

img