Product style icon link Alarm reporting

Alarms are sent with all the information needed to start a report. The API "POST: /Categories /Alarm" starts an alarm based on a category topic (category_topic).

API elements with their description

ElementDescription
alarm_valuetrue for alarm, false for restored
category_topicUnique category ID defined by client
location_custom_idUnique location ID defined by client
location_idUnique location database ID, generated by the Octalarm alarm dialler
messageText of the alarm (voice, sms, app, etc.)
nameShort name to display alarm on display and logbook
unique_idAlarm modified ID

API methods

"POST: /Categories /Alarm"

{
  "alarm_value": true,
  "category_topic": "cultivation_urg",
  "location_custom_id": "loc_01",
  "message": "dept. 2 temperature too high",
  "name": "dept. 2 temperature",
  "unique_id": "loc_01_alrm_01a1b4"
}

cURL code:

curl -X 'POST' \
  'http://192.168.10.72/rest_api/1/Categories/Alarm' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTI1MzQ0ODgsIm5iZiI6MTYxMjUzNDQ4OCwianRpIjoiNjY0NzI2NzAtYTRkMi00N2ZmLWFiMjUtNzAyMGYwOTkwNWJhIiwiZXhwIjoxNjEyNTM3OTg4LCJpZGVudGl0eSI6IlJFU1QtQVBJXzAwMDUiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MiLCJ1c2VyX2NsYWltcyI6eyJ1c2VyX2lkIjo1LCJyb2xlX2lkIjo1LCJsYW5ndWFnZSI6Im5sLU5MIn19.6xlCrMjNsKd9Eyq5ieS-MScZe6P1idstMCKPs5dfOd8' \
  -H 'Content-Type: application/json' \
  -d '{
  "alarm_value": true,
  "category_topic": "cultivation_urg",
  "location_custom_id": "loc_01",
  "message": "dept. 2 temperature too high",
  "name": "dept. 2 temperature",
  "unique_id": "loc_01_alrm_01a1b4"
}'

Response:

{
  "unique_id": "loc_01_alrm_01a1b4",
  "name": "dept. 2 temperature",
  "message": "dept. 2 temperature too high",
  "category_topic": "cultivation_urg",
  "alarm_value": true,
  "location_id": 3,
  "location_custom_id": "loc_01",
  "category_id": 35
}

Reporting

Good to know:

1. active alarms are stored in volatile memory. This means that these active alarms disappear when the Octalarm alarm dialler restarts;

2. the Octalarm alarm dialler uses:
2.1. the alarm processing of the system alarm unknown location in case of an alarm from an unknown location ID;
2.2. the default category of a specific location on an alarm from an unknown category topic (category_topic).

Note: all alarms from external devices must have their own unique ID (unique_id). The external device:

1. uses this unique ID to initiate an alarm notification via the REST API.

2. must store the unique IDs. If the alarm is restored, or if the alarm becomes active again, the dialler uses this unique ID again.

3. is responsible for keeping locations and categories in sync with the locations and categories created in the dialler. This means the external device:
3.1. should be able to synchronise by retrieving the locations and categories (GET method);
3.2. should be able to add or change the new locations and categories as required (POST- or POST-method).