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 name | Required | Data type | Meaningful value range | Default | Description |
|---|---|---|---|---|---|
| pollingIntervalMs | No | INT | 1000 - | 1000 | processing interval [ms] |
| phoneNumber | YES | STRING | Phone number of the recipient of the SMS | ||
| phoneNumberChannelName | No | STRING | MODULNAME.phoneNumber | Channel for providing the currently set phone number | |
| setPhoneNumberChannelName | No | STRING | MODULNAME.setPhoneNumber | Channel for setting the current telephone number | |
| contextContains | YES (*) | STRING | Regular expression that selects an alarm message with the corresponding context | ||
| messageContains | YES (*) | STRING | Regular expression that selects an alarm message with a corresponding message | ||
| message | No | STRING | Message of the alarm message | Text of the SMS notification (see below) | |
| level | No | STRING | Severity 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
| Information | Value |
|---|---|
| Authors | optiMEAS Measurement and Automation Systems GmbH |
| since smartCORE | 2.8 |
| Module type | Consumer/Producer |
| Dependencies | NONE |