Dominevo
Day-to-day

Device templates

A device template is text with device readings, used on camera overlays and in notifications.

A device template is plain text mixed with live readings from your devices. You write it once; Dominevo fills in the values when the overlay is drawn or the notification is sent.

What you type

Plain text is written as it is. A reading is {{ alias.field }}. Example: Driveway {{ garage.temperature }}.

Names

  • alias is the device's template name (set on the device page). camera always means the camera the text is for (an overlay copied to another camera still means that camera). camera.lastPerson and camera.lastPlate are the last recognition stored for it; they are empty until there is one. Write {{ camera.lastPerson | default('') }} when you want a blank instead of a dash.
  • When two capabilities of the same device share a field name, spell the capability with hyphens turned into underscores: {{ alias.temperature_sensor.temperature }}.

Units and the clock

  • The unit follows the value: {{ garage.temperature | unit('°C') }}. unit converts from the field's base unit and prints the symbol. round limits decimals: {{ garage.temperature | unit('°C') | round(1) }}.
  • The clock is now, not a device: {{ now | time('HH:mm') }}. Tokens: yyyy MM dd HH mm ss. A bare {{ now }} prints the full ISO time.

A condition

{% if garage.humidity > 60 %}damp{% endif %}

When a name cannot be read

An unknown device or an unknown field prints an em dash (—) in that spot. The rest of the line is still written. If several capabilities share the field name and you did not spell the capability, the whole text is refused and nothing is written.

Functions

NameKindWhat it doesExample
unit(symbol, from?)filterConverts a number from the field’s base unit and prints the symbol.{{ garage.temperature | unit('°C') }}
round(digits?)filterRounds a number to the given decimals.{{ garage.temperature | round(1) }}
trunc(digits?)filterCuts decimals toward zero, without rounding.{{ garage.temperature | trunc(1) }}
onoff()filterPrints a boolean as ON or OFF.{{ garage.switch | onoff }}
default(fallback, falsy?)filterReplaces a missing value. The second argument also replaces a false or zero.{{ camera.lastPerson | default('') }}
since()filterHow long ago a timestamp was, as “5 min”.{{ garage.updated | since }}
ago()filterThe same duration as since, followed by “ago”.{{ garage.updated | ago }}
format(pattern)filterPrints one value with a single %s, %d or %.Nf placeholder.{{ garage.temperature | format('%.1f') }}
upper()filterUppercase text.{{ camera.lastPerson | upper }}
lower()filterLowercase text.{{ camera.lastPlate | lower }}
title()filterCapitalises each word.{{ camera.lastPerson | title }}
capitalize()filterCapitalises the first letter.{{ camera.lastPerson | capitalize }}
trim()filterRemoves spaces at both ends.{{ camera.lastPerson | trim }}
abs()filterThe absolute value of a number.{{ garage.power | abs }}
int(fallback?)filterThe whole part of a number.{{ garage.temperature | int }}
float(fallback?)filterReads the value as a decimal number.{{ garage.temperature | float }}
length()filterHow many characters or items.{{ camera.lastPerson | length }}
d(fallback, falsy?)filterThe short name of default.{{ camera.lastPerson | d('') }}
join(separator?)filterJoins a list with a separator.{{ range(3) | join(', ') }}
replace(old, new, count?)filterReplaces text, optionally only the first few times.{{ camera.lastPlate | replace(' ', '') }}
first()filterThe first item of a list.{{ range(3) | first }}
last()filterThe last item of a list.{{ range(3) | last }}
sort(reverse?, caseSensitive?)filterSorts a list. The arguments reverse it or keep case.{{ range(3) | reverse | sort }}
reverse()filterReverses a list.{{ range(3) | reverse }}
sum()filterAdds the numbers in a list.{{ range(3) | sum }}
string()filterPrints the value as text.{{ garage.temperature | string }}
list()filterWraps the value in a list.{{ garage.temperature | list }}
truncate(length, killwords?, end?)filterShortens text to a length, with an ending.{{ camera.lastPerson | truncate(12) }}
time(pattern)filterPrints a timestamp in the server’s time zone. Tokens: YYYY MM DD HH mm ss.{{ now | time('HH:mm') }}
range(stop, start?, step?)globalThe integers up to stop, or from start to stop by step. At most 1000 items.{% for i in range(3) %}{{ i }}{% endfor %}
nowvariableThe hub clock. A bare now prints ISO; time prints a pattern.{{ now | time('HH:mm') }}
cameravariableThe device this text is written for. It stays correct when the text is copied to another camera.{{ camera.temperature }}
loopvariableThe for-loop counter (index, length) inside {% for %}.{% for i in range(3) %}{{ loop.index }}{% endfor %}
lastPersonvariableThe last person recognised on this camera, empty until there is one.{{ camera.lastPerson }}
lastPlatevariableThe last plate recognised on this camera, empty until there is one.{{ camera.lastPlate }}

Where you use it

  • Camera overlay (OSD): Detection → OSD, open a camera, and for each layer choose None, Named template or Customize. Customize is the template field: + Device value, + Function, and Ctrl+Space. With unit is on when the field has a unit.
  • Notifications: a message body uses the same field.
  • Named templates: Detection → OSD → Templates edits each template with that same field.