Skip to content

BLL Coding

Arie J. Godschalk edited this page Nov 15, 2026 · 7 revisions

BLL coding and expressions

Home · Flow cards · Formatting · Supported apps

For practical examples, see BLL coding examples. For syntax, format codes and more examples by method, see the method reference.

Text containing BLL coding

In a text argument explicitly supported by BLL or another app, wrap each JavaScript expression in {[ ... ]}. The app decodes it and substitutes its result into the text. Multiple expressions may appear in one supported text value. The Coding page in app settings includes live examples.

If an expression stays literal, verify that BLL is installed and running, the specific field is decoded, and the syntax is valid. Some text-decoding errors can leave the original text unchanged.

Expression-only cards

Execute BLL-expression, Execute BLL-expression (as Tag) and the BLL expression condition take the expression itself, without {[ ]}.

An action can save the result to a variable or expose result tags. A condition should produce a boolean. Execute Text (as Tag) instead takes ordinary text with embedded {[ ... ]}. Do not confuse these two forms.

The method reference describes the available formatting functions, modules, constants and custom functions.

Custom functions

Functions saved in app settings can be shared by BLL expressions. See custom functions for setup, examples and precautions.

Math.js Flow cards

The older Math.js expression action and condition are separate from JavaScript BLL expressions. They substitute BLL variable names between dollar signs before evaluating the Math.js expression. Do not assume that this variable syntax works in BLL JavaScript expressions. See the legacy Math.js examples.

Common forum pitfalls

  • A variable name is not its value. Select its tag with the Flow editor's tag picker. Typing a name such as RainHistory does not retrieve the BLL variable. See the solved variable-reference question.
  • Spaces matter around subtraction with substituted tags. If the second tag is negative, 1- followed by its value can become 1--0.5, which is invalid JavaScript. Write spaces around arithmetic operators, or parenthesize numeric inputs. The forum explanation notes that Homey supplies these tags as substituted text.
  • Use the right evaluation language. date(...) is a BLL helper; math.round(...) calls Math.js from a BLL JavaScript expression. Bare round(...) is not the same thing. See the working rounding correction.
  • Use straight quotes. Smart quotes pasted from a keyboard or document are not JavaScript string delimiters.
  • Check boolean input in your version. Older versions had trouble with Homey's checkmark/cross substitutions. The follow-up reports this fixed; do not copy old workarounds without checking the current result.
  • A stale tag can belong to a different variable. If you replace a Homey Logic variable with a BLL variable of the same name, reselect the tag: the original still refers to its old source. See the Telegram example.

For practical solutions rather than syntax, use the example collections.

Clone this wiki locally