basic.formula
calculate values and display
Parameters
{{basic.formula(id, item, unit, formula) }}
id
unique id for this widget
item
one or more item(s). More items in array-form: [ item1 , item2 ]
unit
unit for displaying, if that unit is found in the language-file that formating is been used (optional)
formula
formula to use: SUM(VAR), AVG(VAR), SUB(VAR), VAR1 + VAR2, ... "VAR" is replaced with all item(s), "VAR1", "VAR2"... is replaced with the appropriate item of the list (optional, default: SUM(VAR))
Example
{{ basic.formula('formula1', ['bath.value'], 'V') }}<br />
{{ basic.formula('formula2', ['bath.p1', 'bath.p2', 'bath.p3'], 'W', 'SUM( VAR )') }}<br />
{{ basic.formula('formula3', ['bath.p1', 'bath.p2', 'bath.p3'], 'W', 'AVG( VAR ) * 3 / 100') }}<br />
{{ basic.formula('formula4', 'bath.value', 'Mwh') }}<br />
a voltage:
---
actual power:
---
some calc:
---
a unknown unit:
---
Author:Martin Gleiß and others
inspired by Raik Alber