Skip to content

NovaStar Program Reference / Alarms and Notification / nsalarm-notify-sms


Overview

The nsalarm-notify-sms sends alarm messages by SMS using Twilio.

Command Line Usage

The command line syntax is:

nsalarm-notify-sms [--help] alarmId actionId triggerId pointId alarmTime alarmValue alarmInterval triggerTime [-reset] [-test]

This command line syntax aligns with other alarm notification programs, allowing it to be called the same way as them, though not all the parameters are used in every message.

nsalarm-notify-sms Command Line Parameters

Parameter                                 Description Required?
--help Displays the usage.
alarmId The id of the alarm. Required
actionId The id of the alarm action. Required
triggerId The id of the alarm trigger. Required
pointId The id (not point numid) of the point. Required
alarmTime The time of the alarm. Optional
alarmValue The value of the alarm. Optional
alarmInterval The interval for the alarm. Optional
triggerTime The time the alarm was triggered. Optional
-reset Sends the SMS as if the alarm state is reset, regardless of the actual state. Optional
-test Prefixes message with TEST. Optional

Examples

nsalarm-notify-sms 38664 60 278 3397

Sends the information contained in alarm 38664 to the contacts associated with the action 60 with information from the trigger 278 and the point 3397. This is the minimum number of fields required.

Scheduling

This program does not need to be scheduled and should not be, as it will be called via alarm actions every time it should run.

Database Configuration

To run this program properly, follow these steps:

  1. Create alarm_contacts for each phone number to be notified. a. The contact field should be set to a phone number, in the format ########## - e.g. 9708675309, where 970 is the area code.
  2. Create an alarm_action. a. Set the command to nsalarm-notify-sms (may require setting the command type to custom first).
  3. Assign the alarm_contacts to the alarm_action.

This can be done using the NovaStar administrator.

Troubleshooting

PermissionError: [Errno 13] Permission denied: 

The program was run with insufficient permissions, or a package was installed with the wrong permissions. Try running the program with sudo or reinstall Python packages with the --user option.