Skip to content

App Better Logic Library

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

Better Logic Library with BLL coding

Supported apps · Flow actions · Examples

Other apps can also decode BLL expressions in their supported fields. For example, see Chronograph.

BLL supports its own coding in Set text variable, Set a variable and Execute Text (as Tag). In those supported text fields use {[ ... ]}:

Today is {[ date("dddd") ]}.
The result is {[ math.round(3.14159, 2) ]}.

For an expression-only card such as Execute BLL-expression (as Tag), enter math.round(3.14159, 2) without the delimiters, and select the number tag in the next card. Use Execute Text (as Tag) when you want ordinary text and expressions combined, and select its text tag.

Try expressions in the Coding page of BLL's settings first. For syntax, custom functions and more examples, see BLL coding.

Community example: generate a message without a variable

In post 250 of the users topic, the author recommends Execute Text (as Tag) when you want to combine ordinary text with Flow tokens. Enter the text directly, insert the tokens, and connect the text result to the next card. You do not need to concatenate the pieces with quotes or plus signs.

Use an embedded expression only for the part that needs processing:

Report at {[ date("HH:mm") ]}: average {[ number(math.mean([18, 20, 22]), 1) ]}

This fixed-input message is an adaptation. The output is a temporary tag, so no shared status variable is needed just to pass the message to a later notification or logging card.

Community example: check sensor age

The sensor-age example retrieves a variable's properties and subtracts its numeric timestamp from now, then converts the millisecond difference to minutes. The current source returns milliseconds since the Unix epoch for the token labeled Last Changed (UTC tick); despite its label, it is not a .NET tick value. See the complete freshness example for the Flow screenshot, numeric expression and threshold checks.

Community example: store a list in a text variable

The array walkthrough initializes a text variable to [], appends readings through a custom function, and totals the result. See lists and rolling history for bounded rainfall history, selection and sum examples.

More app-native examples

Related audio URL workflow

For a separate Homey speaker workflow, see Music URL Converter's first-sound walkthrough, example using a URL from another app, and Play URL card. This is a related-app reference, not a claim that the converter decodes BLL expressions. Check its formats and limits: the speaker feature is required, audio Content-Type is checked exactly, WAV is limited to 900,000 bytes, and the MP3 limit checks the advertised Content-Length (15,000,000 bytes), not a hard cap on bytes downloaded. Completion of a split-MP3 card does not mean the whole track has finished.

Community discussions and current API notes

  • The user topic contains practical examples for BLL coding, settings, arrays, and time calculations. The array walkthrough in post 35 is the source for the JSON-text list approach above.
  • The developer topic explains the BLL npm client, permission, and initialization. Check the package's current documentation before copying older integration snippets.
  • A 2024 HomeyScript question shows an older apiPut call that fails with the current API. The examples in API use the current options-object methods and BLL's current routes.

Clone this wiki locally