Working with Pebble Language in evalink talos
Pebble Language Basics
Pebble is a templating language originally developed by Mitchell Borke. It is inspired by Twig (PHP), Jinja2 (Python), and Liquid (Ruby).
It’s written in Java, lightweight, fast, and designed for server-side rendering of dynamic content such as emails, messages, notifications, or configuration templates.
Pebble lets you insert logic into static text, for example, a message template that dynamically pulls in user, DeviceID, or event data from evalink talos.
The system renders the template at runtime, replacing placeholders with actual values from the event or workflow context.
In evalink talos Pebble expressions can be used in:
-
Webhook payloads
-
Notification bodies
-
Check Condition steps
-
Advanced settings of workflow steps
Pebble processes templates that combine:
-
Static text (HTML, plain text, JSON, etc.)
-
Dynamic expressions enclosed in
{{ ... }}— for inserting variables. -
Logic statements enclosed in
{% ... %}— for loops, conditions, and includes.
The result is a fully rendered string that can be sent, displayed, or stored in evalink talos.
Pebble Language Use in evalink talos
You can use Pebble for the following scenarios in evalink talos:
- Customize Notifications and Messages
Allow administrators to define templates for alerts, emails, or system messages that include variables from the system context (e.g., device names, event timestamps, user data).
Example in evalink talos:
Alarm triggered at {{ device.name }} on {{ alarm.timestamp | date("yyyy-MM-dd HH:mm") }}
- Generate Dynamic Configurations
In automation workflows or integration scripts, Pebble expressions can dynamically fill fields or API payloads with contextual values:
"device_id": "{{ device.id }}",
"status": "{{ alarm.alarmStatus }}"
}
- Conditional Logic in Templates
Pebble supports control structures — so templates can adapt based on logic:
🚨 Critical alert: {{ alarmCode }}
{% else %}
ℹ️ Notification: {{ alarmCode }}
{% endif %}
- Reusable and Modular Templates
Pebble in evalink talos supports includes, letting users reuse parts of templates:
{% include 'footer.peb' %}
Pebble Operators and Functions in evalink talos
Pebble language has a set list of elements which you can use. For more details, see page
Pebble Templates — Basic Usage
For user convenience, evalink talos extends the standard Pebble templating language with several custom functions and operators.
The table below lists common and custom Pebble filters used in evalink talos.
| Filter | Description | Example |
|---|---|---|
json | Serializes an object to JSON. | {{ alarm | json }} |
date | Formats timestamps into a readable date/time string. | {{ alarm.timestamp | date("dd.MM.yyyy HH:mm", timeZone="Europe/Zurich") }} |
toTime | Creates a timestamp for a specific time of day, with optional day offset. | {{ now | toTime("13:00", 1, "UTC") }} |
bytes | Converts a number into a byte-size string. | {{ 2048 | bytes }} |
toString | Converts a value to a string. | {{ alarm.alarmCode | toString }} |
toInt | Converts a value to an integer. | {{ "42" | toInt }} |
toLong | Converts a value to a long. | {{ "1694085805" | toLong }} |
toFloat | Converts a value to a float. | {{ "3.14" | toFloat }} |
hex | Encodes binary data as a hex string. | {{ files()[0].data | hex }} |
decodeHex | Decodes a hex string to binary. | {{ hexString | decodeHex }} |
base64 | Encodes binary data as Base64 (primarily used for file content). | {{ files()[0].data | base64 }} |
decodeBase64 | Decodes a Base64 string. | {{ payload | decodeBase64 }} |
get | Safe getter for maps or JSON-like objects. | {{ device.attributes | get("color") }} |
distinct | Removes duplicate items from a list. | {{ peopleList | distinct }} |
shuffle | Randomizes the order of list items. | {{ responders | shuffle }} |
extractText | Extracts text using regex groups. | {{ text | extractText('Zone ([0-9]+)', 1) }} |
urlEncode | URL-encodes a value for safe use in URLs (query parameters or paths). Must be used with the pipe syntax. | {{ address | urlEncode }} |
The table below lists Pebble functions used in evalink talos:
| Function | Description | Example |
|---|---|---|
toJson() | Converts an object into a JSON string. | {{ toJson(alarm) }} |
fromJson() | Parses a JSON string into a Pebble object. | {{ fromJson(alarm.payload).SomeField }} |
dump() | Alias of toJson() — outputs the object as JSON. | {{ dump(device) }} |
random() | Returns a random number (integer). | {{ random(100,200) }} |
encodeURL(value) | Returns a URL-encoded version of characters like +, ?, &, etc. | {{ encodeURL(step.zone_name) }} |
default | Specifies a fallback value if the input is empty. | {{ device.customerCompany | default("No Company") }} |
Pebble Dictionary in evalink talos
Pebble templates in evalink talos have access to a rich dictionary of built-in variables, functions, and placeholders. These values come from the alarm event, the device, the workflow context, or system metadata.
You can reference them directly inside templates using the standard Pebble syntax:
{{ variableName }}
{{ object.property }}
{{ functionName() }}
The tables below list all available placeholders grouped by category, with descriptions and usage examples.
Alarm Hints
| Name | Description | Example Usage |
|---|---|---|
alarmMessage() | Preformatted alarm summary text. | {{ alarmMessage() }} |
alarmText() | Additional textual description of the alarm. | {{ alarmText() }} |
address | Full site address. | {{ address }} |
alarmCode | Alarm code (e.g., BA, FI). | {{ alarmCode }} |
alarmZone | Zone where the alarm occurred. | {{ alarmZone }} |
alarmPartition | Partition number/name. | {{ alarmPartition }} |
Alarm Details
| Placeholder | Description | Example |
|---|---|---|
alarm.Id | Unique long ID of the alarm. | {{ alarm.alarmId }} |
alarm.shortId | Short-form alarm ID. | {{ alarm.shortId }} |
alarm.timestamp | Timestamp (Unix) in milliseconds. | {{ alarm.timestamp }} |
alarm.timestamp | date | Default formatted date. | {{ alarm.timestamp | date }} |
alarm.timestamp | date(...) | Custom formatted date. | {{ alarm.timestamp | date("dd.MM.yyyy HH:mm", timeZone="Europe/Zurich") }} |
alarm.date | Date object. | {{ alarm.date }} |
alarm.testMessage | Whether alarm is test-only. | {{ alarm.testMessage }} |
alarm.alarmStoredDate | When alarm was stored (in human-readable format). | {{ alarm.alarmStoredDate }} |
alarm.alarmStoredTimestamp | Stored timestamp. | {{ alarm.alarmStoredTimestamp }} |
alarm.alarmValue | Alarm value (varies by type). | {{ alarm.alarmValue }} |
alarm.alarmCode | Alarm code. | {{ alarm.alarmCode }} |
alarm.alarmType | Alarm type (e.g., BURGLARY). | {{ alarm.alarmType }} |
alarm.alarmMsg | Raw alarm message text. | {{ alarm.alarmMsg }} |
alarm.alarmZone | Zone number. | {{ alarm.alarmZone }} |
alarm.alarmZoneName | Human-readable zone name. | {{ alarm.alarmZoneName }} |
alarm.partition | Partition number. | {{ alarm.partition }} |
alarm.partitionName | Partition name. | {{ alarm.partitionName }} |
alarm.user | User ID or name. | {{ alarm.user }} |
alarm.userName | Username text. | {{ alarm.userName }} |
alarm.technical | Whether alarm is technical. | {{ alarm.technical }} |
alarm.severity | Severity value. | {{ alarm.severity }} |
alarm.deviceId | Device ID that produced the alarm. | {{ alarm.deviceId }} |
alarm.alarmStatus | Current status (e.g., INITIAL). | {{ alarm.alarmStatus }} |
alarm.deviceGroupId | Group ID of the site/device. | {{ alarm.deviceGroupId }} |
alarm.payload | Raw payload (JSON text). | {{ alarm.payload }} |
alarm.headers['myHeader'] | Specific alarm header value. | {{ alarm.headers['myHeader'] }} |
alarm.eventName | Event name. | {{ alarm.eventName }} |
Device Details
| Placeholder | Description | Example |
|---|---|---|
device.id | A unique ID of a device (Site in evalink talos). | {{ device.id }} |
device.companyId | Company ID. | {{ device.companyId }} |
device.evalinkDeviceId | Device (evalink talos Site) Name. | {{ device.evalinkDeviceId }} |
device.customerCompany | Customer company name. | {{ device.customerCompany }} |
device.customerFirstName | Customer first name. | {{ device.customerFirstName }} |
device.customerLastName | Customer last name. | {{ device.customerLastName }} |
device.customerPhone | Customer phone. | {{ device.customerPhone }} |
device.customerEmail | Customer email. | {{ device.customerEmail }} |
device.customerZip | ZIP code. | {{ device.customerZip }} |
device.customerCity | Customer city. | {{ device.customerCity }} |
device.customerStreet | Street address. | {{ device.customerStreet }} |
device.customerState | State. | {{ device.customerState }} |
device.customerCountry | Country. | {{ device.customerCountry }} |
device.installerCompany | Installer company. | {{ device.installerCompany }} |
device.installerFirstName | Installer first name. | {{ device.installerFirstName }} |
device.installerLastName | Installer last name. | {{ device.installerLastName }} |
device.installerEmail | Installer email. | {{ device.installerEmail }} |
device.installerPhone | Installer phone. | {{ device.installerPhone }} |
device.attributes[...] | Value of a Custom field . | {{ device.attributes['attribute'] }} |
device.tags contains 'X' | Check whether a tag exists. | {{ device.tags contains 'Test' }} |
device.active | Whether device is active. | {{ device.active }} |
device.testMode | Device is in test mode. | {{ device.testMode }} |
device.timeZone | Device time zone. | {{ device.timeZone }} |
Alarm, System, and Workflow Context
| Placeholder | Description | Example |
|---|---|---|
workflowId | ID of the running workflow. | {{ workflowId }} |
automated | Whether the workflow is automated. | {{ automated }} |
now | Current timestamp. | {{ now }} |
alarmName('en') | Localized alarm name. | {{ alarmName('en') }} |
alarmDescription('de') | Localized alarm description. | {{ alarmDescription('de') }} |
alarmShareLink() | Shareable link to alarm details. You can include the link in an SMS send upon alarm creation and give the recipient access to alarm details. | {{ alarmShareLink() }} |
Common comparisons and operators
When using values from the Pebble Dictionary (for example alarm.*, device.*, or step results), you can add logic with standard Pebble operators. These operators are typically used inside {% if %} blocks.
| Operator | Meaning | Example |
|---|---|---|
== | equals | {% if alarm.alarmCode == 'E205' %}...{% endif %} |
!= | not equals | {% if alarm.alarmType != 'BURGLARY' %}...{% endif %} |
> | greater than | {% if jump.executionCount > 3 %}Call the police!{% endif %} |
< | less than | {% if alarm.severity < 3 %}Low severity {% endif %} |
>= | greater than or equal | {% if alarm.severity >= 6 %}High severity{% endif %} |
<= | less than or equal | {% if alarm.severity <= 3 %}Low severity{% endif %} |
is empty | value is missing / blank | {% if device.customerCompany is empty %}{{ device.evalinkDeviceId }}{% endif %} |
is not empty | value is present | {% if alarm.headers['myHeader'] is not empty %}{{ alarm.headers['myHeader'] }}{% endif %} |
contains | list contains a value | {% if device.tags contains 'Test' %}Test device{% endif %} |
and | logical AND | {% if device.active and (device.testMode == false) %}...{% endif %} |
or | logical OR | {% if alarm.alarmType == 'PANIC' or alarm.alarmType == 'BURGLARY' %}...{% endif %} |
not | negation | {% if not (device.tags contains 'Test') %}...{% endif %} |