Skip to content

Convert

The Convert operation coerces a single input value into a chosen target type. It is the canonical way to turn MQTT payload strings into numbers, booleans into labels, or numeric results into formatted strings — all through one explicit node with a single On Error verb.

Inputs

PortTypeRequiredDescription
>BooleanNoOptional gate. When closed, the path stops without an error signal.
InString | Binary | Number | Boolean | Map | ArrayYesThe value to convert. Binary is decoded as UTF-8 before further rules apply, except for the JSON text target, which takes a Binary as base64. A Map or an Array is read by the JSON text target only.

Outputs

PortTypeDefaultDescription
Outfollows Output FormatNilThe converted value, typed per the selected Output Format.

Properties

NameTypeDefaultDescription
Output FormatStackedDataSetStrict IntegerThe target type and branch-specific fields (see table below).
 Strict IntegerInput must be integer-valued; any fractional content fails the Node.
 Truncated IntegerFractional inputs truncate toward zero (-2.9 → -2).
 Rounded IntegerFractional inputs round half-away-from-zero (0.5 → 1).
 FloatAny numeric-parsable input becomes a double-precision Number.
 StringRendered via fmt format spec. Boolean inputs bypass fmt — see True text / False text.
  FormatString"{}"fmt-style format string. Default {} emits each input’s natural form.
  True textString"true"Emitted when the input is Boolean true.
  False textString"false"Emitted when the input is Boolean false.
 BooleanString / Binary inputs are matched against True / False value lists. Numeric input != 0 is true.
  True valuesString"true,1,yes,on"Comma-separated list of strings that map to true.
  False valuesString"false,0,no,off"Comma-separated list of strings that map to false.
  Case sensitiveBooleanfalseOff = case-insensitive ASCII match.
 JSON textThe input as JSON, through the one mapping every egress uses: integers as digits, floats shortest round-trip, binary as base64, an address as its text. Any input.
On ErrorComboStop this branchPer-op On Error verb (Stop this branch / Continue with the last value / Continue with the fallback). See the Error Handling guide.

State on Reload

Output values are preserved across restarts within the configured time window.


InputStrict IntegerTruncated IntegerRounded IntegerFloatStringBooleanJSON text
Integer 4242424242.0via Format!= 0JSON
Float 42.042424242.0via FormattrueJSON
Float 42.7fail424342.7via FormattrueJSON
Float -42.7fail-42-43-42.7via FormattrueJSON
Float NaN / ±Inffailfailfailpass-throughvia FormatfailJSON
Boolean true / false1 / 01 / 01 / 01.0 / 0.0True text / False texttrue / falseJSON
String "42"42424242.0via Formatmatch listsJSON
String "42.7"fail424342.7via Formatmatch listsJSON
String "42abc"failfailfailfailvia Formatmatch listsJSON
String "hello"failfailfailfailvia Formatmatch listsJSON
String empty / whitespacefailfailfailfailvia Format (empty OK)failJSON
Binary (valid UTF-8)decode → String rulesdecode → String rulesdecode → String rulesdecode → String rulesdecode → Formatdecode → match listsJSON
Binary (invalid UTF-8)failfailfailfailfailfailJSON
MapfailfailfailfailfailfailJSON
ArrayfailfailfailfailfailfailJSON

“fail” rows fail the Node, and its On Error verb resolves the failure.


Output Format: Strict Integer   In: "42"

Out: 42


  • MQTT payload parsing — the MQTT Subscription passes payloads as strings; feed into a Convert node to get a typed value ready for Math, Compare, or Hysteresis.
  • Display formatting — turn an intermediate number or boolean into a user-facing string with fmt specifiers or custom labels.
  • Normalising truthy strings — collapse “yes” / “true” / “1” / “enabled” from different producers into a single Boolean for downstream Gates.

Convert can hit these errors: an unconnected input, a Nil value, an unparseable string / binary, an out-of-range numeric result (for Integer targets), an invalid UTF-8 byte sequence (for Binary input), or a Format spec that doesn’t match the input type (for String output).

Any of these triggers the On Error verb you picked. See the Error Handling guide for the common On Error model; Convert’s options are:

VerbWhat it does
Stop this branch (default)This Node and its dependents stop; Out keeps its value and reads as a failed update.
Continue with the last valueDependents run on the value Out already holds, not stamped as new; it reads as a failed update.
Continue with the fallbackDependents run on Out’s per-output Fallback, stamped as this run’s value; it reads as a failed update. The Editor refuses a Task where the Fallback is unset.

The per-output Fallback editor (Settings panel, under the Out port) lets you pick the fallback type — Boolean / Integer / Float / String — and enter the value. Match the type to the chosen Output Format so downstream type-mask checks accept the fallback. For Float outputs, you can enter a NaN literal directly into the Float fallback field for the classic divide-by-zero detection pattern downstream.


  • Only one transformation per operation; for chained conversions (e.g. trim → parse int), chain a StringOperations node into a Convert node.
  • ASCII-only case folding for Boolean value-list matching. If you need to accept Unicode-cased truthy strings (e.g. Turkish i/ı), pre-normalise with StringOperations’ Lowercase transform.
  • NaN and ±Inf are not accepted as literal strings on the wire for Float output; if you genuinely need to emit NaN, use the NaN fallback branch, or use a Constant node.