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
aliasis the device's template name (set on the device page).cameraalways means the camera the text is for (an overlay copied to another camera still means that camera).camera.lastPersonandcamera.lastPlateare 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') }}.unitconverts from the field's base unit and prints the symbol.roundlimits decimals:{{ garage.temperature | unit('°C') | round(1) }}. - The clock is
now, not a device:{{ now | time('HH:mm') }}. Tokens:yyyyMMddHHmmss. 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
| Name | Kind | What it does | Example |
|---|---|---|---|
unit(symbol, from?) | filter | Converts a number from the field’s base unit and prints the symbol. | {{ garage.temperature | unit('°C') }} |
round(digits?) | filter | Rounds a number to the given decimals. | {{ garage.temperature | round(1) }} |
trunc(digits?) | filter | Cuts decimals toward zero, without rounding. | {{ garage.temperature | trunc(1) }} |
onoff() | filter | Prints a boolean as ON or OFF. | {{ garage.switch | onoff }} |
default(fallback, falsy?) | filter | Replaces a missing value. The second argument also replaces a false or zero. | {{ camera.lastPerson | default('') }} |
since() | filter | How long ago a timestamp was, as “5 min”. | {{ garage.updated | since }} |
ago() | filter | The same duration as since, followed by “ago”. | {{ garage.updated | ago }} |
format(pattern) | filter | Prints one value with a single %s, %d or %.Nf placeholder. | {{ garage.temperature | format('%.1f') }} |
upper() | filter | Uppercase text. | {{ camera.lastPerson | upper }} |
lower() | filter | Lowercase text. | {{ camera.lastPlate | lower }} |
title() | filter | Capitalises each word. | {{ camera.lastPerson | title }} |
capitalize() | filter | Capitalises the first letter. | {{ camera.lastPerson | capitalize }} |
trim() | filter | Removes spaces at both ends. | {{ camera.lastPerson | trim }} |
abs() | filter | The absolute value of a number. | {{ garage.power | abs }} |
int(fallback?) | filter | The whole part of a number. | {{ garage.temperature | int }} |
float(fallback?) | filter | Reads the value as a decimal number. | {{ garage.temperature | float }} |
length() | filter | How many characters or items. | {{ camera.lastPerson | length }} |
d(fallback, falsy?) | filter | The short name of default. | {{ camera.lastPerson | d('') }} |
join(separator?) | filter | Joins a list with a separator. | {{ range(3) | join(', ') }} |
replace(old, new, count?) | filter | Replaces text, optionally only the first few times. | {{ camera.lastPlate | replace(' ', '') }} |
first() | filter | The first item of a list. | {{ range(3) | first }} |
last() | filter | The last item of a list. | {{ range(3) | last }} |
sort(reverse?, caseSensitive?) | filter | Sorts a list. The arguments reverse it or keep case. | {{ range(3) | reverse | sort }} |
reverse() | filter | Reverses a list. | {{ range(3) | reverse }} |
sum() | filter | Adds the numbers in a list. | {{ range(3) | sum }} |
string() | filter | Prints the value as text. | {{ garage.temperature | string }} |
list() | filter | Wraps the value in a list. | {{ garage.temperature | list }} |
truncate(length, killwords?, end?) | filter | Shortens text to a length, with an ending. | {{ camera.lastPerson | truncate(12) }} |
time(pattern) | filter | Prints a timestamp in the server’s time zone. Tokens: YYYY MM DD HH mm ss. | {{ now | time('HH:mm') }} |
range(stop, start?, step?) | global | The integers up to stop, or from start to stop by step. At most 1000 items. | {% for i in range(3) %}{{ i }}{% endfor %} |
now | variable | The hub clock. A bare now prints ISO; time prints a pattern. | {{ now | time('HH:mm') }} |
camera | variable | The device this text is written for. It stays correct when the text is copied to another camera. | {{ camera.temperature }} |
loop | variable | The for-loop counter (index, length) inside {% for %}. | {% for i in range(3) %}{{ loop.index }}{% endfor %} |
lastPerson | variable | The last person recognised on this camera, empty until there is one. | {{ camera.lastPerson }} |
lastPlate | variable | The 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.