Tutorials

Video tutorials and step-by-step guides to help you learn Fentrica.

Setting Up Alarm Notifications via SMS and E-mail

In this tutorial you will configure Fentrica to send an SMS to the on-call technician and an e-mail to the facility manager whenever a Fault-priority alarm is raised on a site. By the end you will have:

  • A General Automation Template for SMS (short, one-line summary)
  • A General Automation Template for e-mail (formatted, with subject and HTML body)
  • A site-level Alarm Notification rule that fires both actions when a critical alarm becomes active and again when it resolves

What you will build

One-time setup, automatic forever after

Create SMS templateCreate e-mail templateCreate notification ruleFilter by priorityWire SMS + e-mail actionsEnable and test

Two layers, two locations

Templates are reusable and live at the organization level — define them once and every site under the organization can reference them.
Notification rules are scoped to a single site — different buildings can route their alarms to different audiences while still using the same templates.

Requirements

  • Manager access to an organization and at least one site
  • A site with at least one active alarm source (a device alarm from a connected BMS or PLC, an analytic alarm, or a Smart Alarm)
  • A recipient phone number (with country code, e.g. +372555555) and e-mail address for testing

System Overview

The notification engine watches every alarm created on the site and dispatches a message for each enabled rule whose triggers match. For background on what triggers are available and how rules are evaluated, see Alarm Notifications.


Step 1 — Create the SMS message template

SMS is billed per segment (typically 160 characters), so this template stays short and information-dense.

  1. Open Organization in the main menu.
  2. Scroll to the Message Templates section and click New.
  3. Fill in the fields:
FieldValue
NameAlarm — SMS (compact)
TypeGeneral Automation Template
BodySee snippet below
[{{property.name}}] {{alarm.state}}: {{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}} (prio {{alarm.priority}}) at {{alarm.activatedAt}}
Why General Automation Template?

Alarm Notifications only see templates whose type is set to General Automation Template. The other types in the dropdown (Access PIN, Task Assigned, Maintenance Request, etc.) are reserved for system-generated notifications and are filtered out of the alarm rule picker.

  1. Click Save. The template now appears in the organization template list.

What the placeholders do

PlaceholderRenders to
{{property.name}}Site name — helps when one phone receives alarms from many sites
{{alarm.state}}active, resolved, or ok
{{deviceAlarmDefinition.name}}Name of the device alarm (populated for BMS / PLC alarms)
{{analyticAlarmDefinition.name}}Name of the analytic alarm (populated for Smart Alarms)
{{alarm.priority}}Numeric priority: 0 = Warning, -1 = Anomaly, 1 = Error, 2 = Fault
{{alarm.activatedAt}}Timestamp the alarm became active
One of device or analytic name will be empty

For any given alarm, either deviceAlarmDefinition.* or analyticAlarmDefinition.* is populated — never both. The {{#if ...}} blocks above silently skip the empty one, so the rendered SMS always shows exactly one name.

For the full list of available variables and Handlebars helpers, see Message Templates.


Step 2 — Create the e-mail message template

The e-mail template can be much richer — subject line, HTML body, sender details — because there is no length penalty.

  1. Still under Organization → Message Templates, click New.
  2. Fill in the fields:
FieldValue
NameAlarm — E-mail (full)
TypeGeneral Automation Template
Subject[{{property.name}}] Alarm {{alarm.state}}: {{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}}
From nameFentrica Alerts
Reply-to nameFacility Management
Reply-to addressfacilities@your-org.example
  1. Set the Body (plain-text fallback for clients that strip HTML):
An alarm was raised on {{property.name}}.

Alarm:       {{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}}
Priority:    {{alarm.priority}}
State:       {{alarm.state}}
Activated:   {{alarm.activatedAt}}
{{#if alarm.resolvedAt}}Resolved:    {{alarm.resolvedAt}}
{{/if}}Source:      {{alarm.source}}

Description:
{{#if deviceAlarmDefinition.description}}{{deviceAlarmDefinition.description}}{{/if}}{{#if analyticAlarmDefinition.description}}{{analyticAlarmDefinition.description}}{{/if}}

Open the site in Fentrica to acknowledge or investigate.
  1. Set the HTML Body for clients that render HTML:
<p>An alarm was raised on <strong>{{property.name}}</strong>.</p>
<table>
  <tr><td><strong>Alarm</strong></td><td>{{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}}</td></tr>
  <tr><td><strong>Priority</strong></td><td>{{alarm.priority}}{{#if (compare alarm.priority "==" 2)}} (Fault){{/if}}</td></tr>
  <tr><td><strong>State</strong></td><td>{{alarm.state}}</td></tr>
  <tr><td><strong>Activated</strong></td><td>{{alarm.activatedAt}}</td></tr>
  {{#if alarm.resolvedAt}}<tr><td><strong>Resolved</strong></td><td>{{alarm.resolvedAt}}</td></tr>{{/if}}
  <tr><td><strong>Source</strong></td><td>{{alarm.source}}</td></tr>
</table>
<p>{{#if deviceAlarmDefinition.description}}{{deviceAlarmDefinition.description}}{{/if}}{{#if analyticAlarmDefinition.description}}{{analyticAlarmDefinition.description}}{{/if}}</p>
  1. Click Save.
The `compare` helper

The HTML body uses {{#if (compare alarm.priority "==" 2)}} to label the numeric priority 2 as "Fault". The compare helper, plus and, or, between, and several string/array helpers, are documented in Message Templates → Custom Helpers.

More about message templates — fields, the full variable catalogue, Handlebars syntax (conditionals, loops), and every custom helper (compare, or, and, between, split, trim, toNumber, index, last).


Step 3 — Create the notification rule on the site

Now switch from organization-level templates to the site where alarms originate.

  1. Open the site you manage.
  2. Navigate to Automation.
  3. Click Alarm Notifications.
  4. Click New and give the rule a descriptive name:
FieldValue
NameOn-call SMS + manager e-mail — Faults
Enabled
  1. Click Save. The rule opens in detail view with empty When (triggers) and Then (actions) columns.
Name by audience, not by recipient

"On-call SMS + manager e-mail — Faults" survives staff changes; "SMS to Anna" doesn't. When Anna leaves, you only need to update her phone number in the action — the rule keeps working.


Step 4 — Add the trigger (When)

The trigger controls which alarm events fire the rule. We want the rule to fire when a Fault-priority alarm becomes active, and again when it resolves, so the on-call technician hears both the start and the end of the incident.

Trigger A — Fault activated

  1. In the When column, click Create Automation Trigger.
  2. Fill in:
FieldValue
When (type)Created
With PriorityFault
And StateActive
  1. Click Save Trigger.

Trigger B — Fault resolved

  1. Click Create Automation Trigger again.
  2. Fill in:
FieldValue
When (type)Created
With PriorityFault
And StateResolved
  1. Click Save Trigger.

OR triggers

The two triggers combine with OR — the rule fires when either matches. A single rule now covers both ends of the alarm lifecycle (activation and resolution) without duplicating the actions.


Step 5 — Add the SMS action (Then)

The first action sends a short text to the on-call technician.

  1. In the Then column, click Create Automation Action.
  2. Fill in:
FieldValue
ActionSend SMS
To phone number+372555555 (use the on-call number, with country code)
Using Message TemplateAlarm — SMS (compact)
  1. Click Save Action.
Country code is required

Phone numbers without an international prefix (e.g. 555555 instead of +372555555) will be rejected by the SMS gateway. The placeholder text in the field is With country code. (eg. +372555555).


Step 6 — Add the e-mail action (Then)

The second action sends a richer message to the facility manager.

  1. Click Create Automation Action again.
  2. Fill in:
FieldValue
ActionSend e-mail
To e-mail addressfacility-manager@your-org.example
Using Message TemplateAlarm — E-mail (full)
  1. Click Save Action.

AND actions

Both actions are listed in the Then column, so every matching alarm produces both outgoing messages. The SMS and e-mail are dispatched in parallel — neither blocks the other.


Step 7 — Verify the rule

Back on the rule detail page you should see:

  • Summary — Name, Status Enabled, Site
  • When — two trigger cards (Created with Fault/Active, Created with Fault/Resolved)
  • Then — two action cards (Send SMS, Send e-mail)

Trigger a test alarm

The cleanest way to verify the rule end-to-end is to use a Smart Alarm you can force into the active state:

  1. Create a temporary Smart Alarm with Priority = Fault and a trivially-satisfied condition (e.g. count >= 0 within 5 min on any active sensor).
  2. Wait one evaluation cycle (5 minutes) — the alarm should fire.
  3. Confirm the SMS arrives on the on-call phone and the e-mail in the manager's inbox.
  4. Edit the Smart Alarm condition so it no longer matches (e.g. flip the operator) — the platform marks the alarm resolved.
  5. Confirm a second SMS and e-mail arrive announcing the resolution.
  6. Delete the temporary Smart Alarm.
No real fault required

You don't need to manufacture an actual building fault to test notifications. Any Smart Alarm with a satisfied condition produces a real alarm record that the notification engine sees — the rest of the platform treats it identically to a hardware-driven alarm.

More about alarm notifications — rule anatomy, trigger types, priority and state filters, action types, the OR/AND combination semantics, enable/disable behavior, and how messages are dispatched end-to-end.


Variations

Once the basic rule is working, the same pattern extends naturally:

ScenarioTrigger filterActions
Lower-severity warnings during business hours onlyPriority = Warning or Anomaly, State = ActiveE-mail only to manager
Distribution list for resolved faultsPriority = Fault, State = ResolvedE-mail to a shared inbox
Wake the second on-call only for unresolved errorsPriority = Error, State = ActiveSMS to a secondary phone
Send digest to a Microsoft 365 groupAny priorityE-mail to the group address

For each scenario, create a new rule under Automation → Alarm Notifications — the templates from Step 1 and Step 2 are reusable across all of them.

Troubleshooting

ProblemLikely causeFix
Template doesn't appear in the rule action's "Using Message Template" dropdownTemplate type is set to a specific messaging type (e.g. Access PIN E-mail)Open the template and change Type to General Automation Template
SMS not delivered, e-mail worksPhone number missing country codeEdit the SMS action and prefix the number with +<country> (e.g. +372...)
Both messages missingRule is DisabledOpen the rule detail page and click Enable
Rule fires for activation but not for resolutionOnly Trigger A was addedAdd Trigger B with State = Resolved (Step 4)
Message arrives with empty alarm nameTemplate only references deviceAlarmDefinition.name (or only the analytic version)Use both {{#if deviceAlarmDefinition.name}}…{{/if}}{{#if analyticAlarmDefinition.name}}…{{/if}} so the populated one always renders
Several alarms produce duplicate messagesMultiple overlapping rules match the same alarmConsolidate into one rule with two triggers, or tighten each rule's priority/state filters