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
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.
- Open Organization in the main menu.
- Scroll to the Message Templates section and click New.
- Fill in the fields:
| Field | Value |
|---|---|
| Name | Alarm — SMS (compact) |
| Type | General Automation Template |
| Body | See snippet below |
[{{property.name}}] {{alarm.state}}: {{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}} (prio {{alarm.priority}}) at {{alarm.activatedAt}}
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.
- Click Save. The template now appears in the organization template list.
What the placeholders do
| Placeholder | Renders 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 |
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.
- Still under Organization → Message Templates, click New.
- Fill in the fields:
| Field | Value |
|---|---|
| Name | Alarm — E-mail (full) |
| Type | General Automation Template |
| Subject | [{{property.name}}] Alarm {{alarm.state}}: {{#if deviceAlarmDefinition.name}}{{deviceAlarmDefinition.name}}{{/if}}{{#if analyticAlarmDefinition.name}}{{analyticAlarmDefinition.name}}{{/if}} |
| From name | Fentrica Alerts |
| Reply-to name | Facility Management |
| Reply-to address | facilities@your-org.example |
- 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.
- 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>
- Click Save.
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.
- Open the site you manage.
- Navigate to Automation.
- Click Alarm Notifications.
- Click New and give the rule a descriptive name:
| Field | Value |
|---|---|
| Name | On-call SMS + manager e-mail — Faults |
| Enabled | ✅ |
- Click Save. The rule opens in detail view with empty When (triggers) and Then (actions) columns.
"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
- In the When column, click Create Automation Trigger.
- Fill in:
| Field | Value |
|---|---|
| When (type) | Created |
| With Priority | Fault |
| And State | Active |
- Click Save Trigger.
Trigger B — Fault resolved
- Click Create Automation Trigger again.
- Fill in:
| Field | Value |
|---|---|
| When (type) | Created |
| With Priority | Fault |
| And State | Resolved |
- 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.
- In the Then column, click Create Automation Action.
- Fill in:
| Field | Value |
|---|---|
| Action | Send SMS |
| To phone number | +372555555 (use the on-call number, with country code) |
| Using Message Template | Alarm — SMS (compact) |
- Click Save Action.
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.
- Click Create Automation Action again.
- Fill in:
| Field | Value |
|---|---|
| Action | Send e-mail |
| To e-mail address | facility-manager@your-org.example |
| Using Message Template | Alarm — E-mail (full) |
- 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 (
Createdwith Fault/Active,Createdwith 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:
- Create a temporary Smart Alarm with Priority = Fault and a trivially-satisfied condition (e.g.
count >= 0 within 5 minon any active sensor). - Wait one evaluation cycle (5 minutes) — the alarm should fire.
- Confirm the SMS arrives on the on-call phone and the e-mail in the manager's inbox.
- Edit the Smart Alarm condition so it no longer matches (e.g. flip the operator) — the platform marks the alarm resolved.
- Confirm a second SMS and e-mail arrive announcing the resolution.
- Delete the temporary Smart Alarm.
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:
| Scenario | Trigger filter | Actions |
|---|---|---|
| Lower-severity warnings during business hours only | Priority = Warning or Anomaly, State = Active | E-mail only to manager |
| Distribution list for resolved faults | Priority = Fault, State = Resolved | E-mail to a shared inbox |
| Wake the second on-call only for unresolved errors | Priority = Error, State = Active | SMS to a secondary phone |
| Send digest to a Microsoft 365 group | Any priority | E-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
| Problem | Likely cause | Fix |
|---|---|---|
| Template doesn't appear in the rule action's "Using Message Template" dropdown | Template 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 works | Phone number missing country code | Edit the SMS action and prefix the number with +<country> (e.g. +372...) |
| Both messages missing | Rule is Disabled | Open the rule detail page and click Enable |
| Rule fires for activation but not for resolution | Only Trigger A was added | Add Trigger B with State = Resolved (Step 4) |
| Message arrives with empty alarm name | Template 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 messages | Multiple overlapping rules match the same alarm | Consolidate into one rule with two triggers, or tighten each rule's priority/state filters |