Skip to content

Filters

The Liquid filters a widget template can use: Tiledash’s own for readings, and Liquid’s standard ones.

Tiledash’s filters

| round: decimals

A number rounded, to 0 decimals unless given: 21.456 | round: 1 → 21.5.

| decimals: n

A number as text with exactly n decimals (0–3), with the region's decimal mark: 21 | decimals: 1 → "21.0" ("21,0" in the Netherlands); — when empty.

| percent

A 0–1 value as a percentage, written the region's way: 0.62 | percent → "62%" ("62 %" in Germany).

| unit: 'W', capability?

A value with its unit, scaled, written the region's way: 1820 | unit: 'W' → "1.82 kW" ("1,82 kW" in the Netherlands).

| temp: decimals

A temperature with a degree sign, with the region's decimal mark: 21.46 | temp → "21.5°" ("21,5°" in the Netherlands).

| t: name: value

A text of the widget's Messages in the viewer's language: 'battery_low' | t: level: 82.

| on_off

true or false as "On" or "Off", in the viewer's language.

| relative_time

A time as how long ago, in the viewer's language: cap.onoff.lastUpdated | relative_time → "4 min ago".

| quote

Puts a value into a handler as one quoted text, so it can never add steps.

| duration

Seconds as a duration, in the viewer's language: 5400 | duration → "1 h 30 min".

| parse_json

JSON text (a text variable a flow fills) as values to walk: variables['…'].value | parse_json; nil when it isn't JSON.

Liquid’s filters

| strip

Without spaces at its start and end.

| size

How many items a list has, or characters a text.

| last

The last item of a list.

| abs

Without its minus sign.

| ceil

Rounded up to a whole number.

| floor

Rounded down to a whole number.

| escape

HTML characters escaped (output is escaped anyway).

| json

A value as JSON text, for a chart’s data attribute: data="{{ list | json }}".