Skip to main content

SMS alarm module "smsalarms"

Description

The "smsalarms" module makes it possible to send new alarms from the alarm center via SMS.

Interfaces and protocols used

  • Internal smartCORE alarm mechanisms

JSON configuration

The following section describes the entire JSON configuration of the module and explains the individual parameters.

Example configurations (minimal)

{
"module": "smsalarms",
"factory": "smsalarms",
"config":{
"phoneNumber": "+49800762782673",
"messageContains": "some.*RegularExpressionMatchingAlarmMessage"
}
}
{
"module": "smsalarms",
"factory": "smsalarms",
"config":{
"phoneNumber": "+49800762782673",
"contextContains": "some.*RegularExpressionMatchingAlarmContext"
}
}

Example configuration (maximum)

{
"module": "smsalarms",
"factory": "smsalarms",
"config":{
"pollingIntervalMs": 1000,
"phoneNumber": "+49800762782673",
"phoneNumberChannelName": "SomeChannelShowingPhoneNumber",
"setPhoneNumberChannelName": "SomeChannelForSettingTheNumber",
"contextContains": "some.*RegularExpressionMatchingAlarmContext",
"messageContains": "some.*RegularExpressionMatchingAlarmMessage",
"message": "Some message text",
"level": "alarm"
}
}

Global module parameters

Parameter nameRequiredData typeMeaningful value rangeDefaultDescription
pollingIntervalMsNoINT1000 -1000processing interval [ms]
phoneNumberYESSTRINGPhone number of the recipient of the SMS
phoneNumberChannelNameNoSTRINGMODULNAME.phoneNumberChannel for providing the currently set phone number
setPhoneNumberChannelNameNoSTRINGMODULNAME.setPhoneNumberChannel for setting the current telephone number
contextContainsYES (*)STRINGRegular expression that selects an alarm message with the corresponding context
messageContainsYES (*)STRINGRegular expression that selects an alarm message with a corresponding message
messageNoSTRINGMessage of the alarm messageText of the SMS notification (see below)
levelNoSTRINGSeverity of the alarm ("none", "info", "action", "service", "warning", "alarm", "error", "fatal")

(*) optional or both

Configuration of the SMS notification "message"

The SMS message can contain the following elements

  • Text
  • Alarm context expressed by variable ${AlarmContext}
  • Alarm message expressed by variable ${AlarmMessage}
  • unformatted values of any channel (${someChannel})
  • formatted values of any channels using the syntax of printf, such as ${someChannel}{%.2d}
  • Location information (GPS positions), such as ${GPS.Location}
  • Location information with a link to a map service, such as ${GPS.Location}{google} or ${GPS.Location}{openstreetmap}

In addition, both the alarm context and the alarm message can be pre-processed textually using stream editing, whereby back-referencing is possible, e.g.

${AlarmMessage}{s/hello/world/}

Module information

InformationValue
AuthorsoptiMEAS Measurement and Automation Systems GmbH
since smartCORE2.8
Module typeConsumer/Producer
DependenciesNONE