Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Product style icon link Alarm reporting

Alarms include all the information required to initiate a report. Use the API endpoint POST: /Categories/Alarm to trigger an alarm based on a category_topic.

Description of API elements

ElementDescription
alarm_valuetrue for alarm, false for restoration.
category_topicUnique category ID defined by the client.
location_custom_idUnique location ID defined by the client.
location_idUnique location database ID generated by the Octalarm alarm dialler.
messageText of the alarm (used for voice, SMS, app notifications, etc.)
nameShort name used to display the alarm on the display and in the logbook.
unique_idModified unique alarm 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. The dialler stores active alarms in temporary memory. These alarms disappear after a restart.

  2. If the dialler receives an alarm from an unknown location ID, it uses the alarm handling of the system alarm unknown location.

  3. If the dialler receives an alarm from a known location but with an unknown category topic (category_topic), it uses the default category for that specific location.

Note: Each alarm sent by an external device must have a unique ID (unique_id). The external device:

  1. Uses this unique ID to send an alarm notification via the REST API.

  2. Stores each unique ID. When the alarm is restored or reactivated, the dialler references this unique ID again.

  3. Maintains synchronisation of locations and categories with those defined in the dialler. To achieve this, the external device:
    • retrieves locations and categories when synchronising (GET method);
    • adds or updates locations and categories as needed (POST method).