Alarm Notification Templates

Templates can be used to define the alarm that is delivered via the Alarm Notification System (voice, email or pager) or via the text-to-speech feature. These templates can use a combination of words and replaceable tokens to define the content of the alarm message. Templates may be up to 128 characters in length.

Alarm Notification Templates and DialerLocation have been moved from Settings.Dynamic to the default languages file (en.csv). To find a template phrase in the Languages panel of the Application Properties dialog, use the View button to display the Key column. Template phrases use the original property names as keys.

You may still use these properties in [System] section of your Settings.Dynamic file, but you must insert them using the Advanced mode of the Edit Properties dialog. The property will take precedence over the phrase in the language file.

Alternatively, you may create localized template values as properties of a parent Context tag.

For more complex templates you can define your own hook module for most of the tokens. Refer to Alarm Notification Template Hooks

Separate templates are available for each of:

There are also two template configuration options that set the format used for the date and time if these parameters are used as part of the template.

The complete list of replaceable tokens:

Token

Meaning

%A

Area of the Alarm tag.

%C

Custom data provided by the application. (See following notes.)

%D

Date of the alarm

%F Full tag name
%H Short tag name
%K

Station number

(Part of every Polling driver, and Station type. Context tags used as site must be given a property named "Stn", in which the station number may be stored.)

%L

Opt-out message. This is be used only with SMS and EMail templates

The message is stored with the language phrase key AlarmOptOutMsg and defaults to:
Reply with "%0" to stop receiving alarm notifications.

%M

Alarm description

%N

New sentence for email and pager messages.

%O Operator

%P

Priority of the alarm.

%S Status of the alarm

%T

Time of the alarm

%U

Units of the Triggering tag.

%V

Alarm value (this is the value of the alarm trigger at the time that it triggered the alarm)

%W

Pause for ¼ second. Has no effect on email or pager messages.

%Z Setpoint.

Value (%V) and Setpoint (%Z) will use the labels corresponding to these values as stored in the record where applicable. If no labels can be found, the raw numbers will be used.

The %C token in a template can only obtain numeric and text values, not complex values. If a numeric or string value that exists inside a complex value needs to be included in an alarm notification, an AlarmTemplateHookC module will need to be created that returns this value. (Alarm Notification Template Hooks)

The Custom field can be set in a variety of ways:

  • In the Commission() call via the Custom field of the Alarm Configuration record.
  • In the EvaluateAlarm() call via the Custom parameter
  • In any Alarm<Action>Hook module by setting the Custom field of the TransactionInfo structure.

Using expressions in alarm notification templates

Before you proceed, take a last careful look at the available tokens. It is very possible that the information you wish to display is already available as a token. You do not need to use an expression to concat a string. All non-token characters used in the Value field of a custom property in a Context tag will be passed along as a string.

To use expressions in an alarm template, you will have to create a custom tag type with a custom property field and then add the expression to that field. To summarize, you will start out by configuring a regular Context tag and then use that to create a new tag type. Similar to a Context tag, all children of this tag type will inherit the custom property value but now you can use an expression in that field.

Follow these steps:

  1. Grant privileges - enable the "Manage Tag Types" privilege for your account. There are no default account types with this privilege, you must add it separately.
  2. Create a Context tag - In the Tag Browser, create a new Context tag and give it a name such as "EmailTemplateExp"
  3. Assign a Type - In the Type field of the ID tab, type the name of the new tag type. For example, AlarmEmailHandler
  4. Configure the custom field - This starts out the same as adding a custom property to a context tag. Navigate to the Settings tab, click Add, fill in a property name and a label. Click OK.

You must add a label. Alarm notification properties are sensitive to GUIDs and, unless specified, the field name will be their default value. For example, without specifying a label, the AlarmEmailTemplate field label becomes:
%D %T%NArea:%A%NName:%F%NDesc:%M.

  1. Create a custom tag type - Right-click on the Context tag you've just made and select "Create New Type". Keep all defaults and click OK. you can now find your new tag type in the tag selector under Containers or All Tag Types.
  2. Create your custom tag and add an expression - Create a new tag, select your new tag type from the selector and give it a name. In the Other Parameters tab, right-click your custom field and select Add Parameter Expression.

A field containing a valid parameter expression will turn blue. If you don't need an expression, you can still type directly in the field and it will behave like the Value field of a custom property in a normal Context tag; it will take tokens and pass all other characters as a string. (You must type %% to pass a percent sign as part of a string.)