Expressions

Templates resolve data with {moduleId:property} expressions and pipe the result through transforms for formatting and arithmetic. Transforms compose left to right:

{wx:temperature | round:0 | c2f}    → "73"
{dt:hour | towords | uppercase}     → "FOURTEEN"
{sys:battery | gte:80}              → "true"

Pipe transforms (28)

NameSyntaxDescriptionExampleArgument
addvalue | add:addendAdd a number to the value10 → 15 (with add:5)addend — number to add
c2fvalue | c2fConvert Celsius to Fahrenheit0 → 32
c2kvalue | c2kConvert Celsius to Kelvin0 → 273.2
capitalizevalue | capitalizeCapitalize the first characterhello → Hello
ceilvalue | ceilRound up to the nearest integer3.1 → 4
clampvalue | clamp:min:maxConstrain value to a min/max range150 → 100 (with clamp:0:100)min:max — lower and upper bounds
f2cvalue | f2cConvert Fahrenheit to Celsius76 → 24.4
f2kvalue | f2kConvert Fahrenheit to Kelvin32 → 273.2
floorvalue | floorRound down to the nearest integer3.9 → 3
gtevalue | gte:thresholdCheck if value is greater than or equal to threshold85 → true (with gte:80)threshold — comparison value
k2cvalue | k2cConvert Kelvin to Celsius273.15 → 0
k2fvalue | k2fConvert Kelvin to Fahrenheit273.15 → 32
lowercasevalue | lowercaseConvert text to lowercaseAM → am
ltevalue | lte:thresholdCheck if value is less than or equal to threshold70 → true (with lte:80)threshold — comparison value
multiplyvalue | multiply:factorMultiply by a factor10 → 20 (with multiply:2)factor — number to multiply by
ordinalvalue | ordinalConvert a number to ordinal form3 → 3rd
padendvalue | padend:NPad from the end with zeros5 → 50N = target length (default 2)
padstartvalue | padstart:NPad from the start with zeros5 → 05N = target length (default 2)
replacevalue | replace:old:newReplace occurrences of a substringhello → heLLo (with replace:l:L)old:new — string to find and replacement
roundvalue | round:NRound to a number of decimal places3.456 → 3.5 (with round:1)N = decimal places (default 0)
scalevalue | scale:inMin:inMax:outMin:outMaxLinear interpolation between input and output ranges50 → 0.5 (with scale:0:100:0:1)inMin:inMax:outMin:outMax — source and target ranges
substrvalue | substr:start:endExtract a substring by index rangehello → el (with substr:1:3)start:end — zero-based indices
ternaryvalue | ternary:trueVal:falseValConditional output based on true/false valuetrue → yes (with ternary:yes:no)trueVal:falseVal — output for true and false
tocelsiusvalue | tocelsius:UNITConvert any temperature to Celsius76 → 24.4 (with tocelsius:F)UNIT — source unit: C, F, or K
tofahrenheitvalue | tofahrenheit:UNITConvert any temperature to Fahrenheit0 → 32 (with tofahrenheit:C)UNIT — source unit: C, F, or K
tokelvinvalue | tokelvin:UNITConvert any temperature to Kelvin32 → 273.2 (with tokelvin:F)UNIT — source unit: C, F, or K
towordsvalue | towordsConvert a number to English words14 → fourteen
uppercasevalue | uppercaseConvert text to UPPERCASEam → AM