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
| Element | Description |
|---|---|
| alarm_value | true for alarm, false for restoration. |
| category_topic | Unique category ID defined by the client. |
| location_custom_id | Unique location ID defined by the client. |
| location_id | Unique location database ID generated by the Octalarm alarm dialler. |
| message | Text of the alarm (used for voice, SMS, app notifications, etc.) |
| name | Short name used to display the alarm on the display and in the logbook. |
| unique_id | Modified 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:
- The dialler stores active alarms in temporary memory. These alarms disappear after a restart.
- If the dialler receives an alarm from an unknown location ID, it uses the alarm handling of the system alarm unknown location.
- 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:
- Uses this unique ID to send an alarm notification via the REST API.
- Stores each unique ID. When the alarm is restored or reactivated, the dialler references this unique ID again.
- 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).