Formulas

Formulas are mostly connected functions like $ai(sunset) - ai(sunrise)$ (Note the $ as the borders of a formula)

You can use all math operators like "+", "/" and so on.

The operators will work differently depending on the way you use them, so, let's give some example: $2*(2+3)$ will give 6, this is simple math

will give 6, this is simple math $df(s)*2$ will return the number of seconds in current minute and multiply it per 2

will return the number of seconds in current minute and multiply it per 2 $"foo" + "bar"$ will merge "foo" string and "bar" string resulting in "foobar" text, this is useful when you want to join text sentences and numbers

will merge "foo" string and "bar" string resulting in "foobar" text, this is useful when you want to join text sentences and numbers $ai(sunset) - ai(sunrise)$ will subtract 2 dates and return the number of seconds between them, in general a date will be converted in seconds by operators so you can then use it in the formulas If you need more advanced functions like "floor", "ceil" and "sqrt" please look into the mu() function. (via kustom.uservoice)

I think the mosted used formulas are if conditions where you can use comparisons like:

"=" (equals)

">" (greater)

">=" (greater or equal)

"<" (less)

"<=" (less or equal)

boolean operators "&" (AND) or "|" (OR) and parenthesis

Examples are in the codes part of this guide.

Formulas with the Advanced Editor

Text bits aren't the only place for formulas or functions. As you can see in the screenshots below by selecting the item and pressing on the calculator on the top right you presented with the option to use formulas in multiple places (I won't list every place, because it's pointless. just search around).