Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CspmIT/centinela-front/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Alarms in Centinela monitor variables and trigger notifications when specific conditions are met. They support both simple conditions and complex combined logic.

Alarm Types

Simple Alarms

Monitor a single variable against a threshold:
  • Presión > 5 bar
  • pH < 6.5
  • Cloro entre 0.5 y 1.5 mg/L

Combined Alarms

Monitor multiple variables with logical operators:
  • (Presión > 5) AND (Caudal < 10)
  • (Temperatura > 30) OR (Humedad > 80)

List All Alarms

Retrieve all configured alarms:
cURL
curl -X GET "https://masagua.cooptech.com.ar/api/getAlarms" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
Response:
{
  "data": [
    {
      "id": 1,
      "name": "Presión Alta Sistema Principal",
      "type": "single",
      "id_influxvars": 12,
      "var_name": "Presión Principal",
      "condition": ">",
      "value": 5.5,
      "value2": null,
      "repeatInterval": 15,
      "status": true,
      "hasTimeRange": true,
      "startime": "08:00",
      "endtime": "18:00"
    },
    {
      "id": 2,
      "name": "Cloro Fuera de Rango",
      "type": "single",
      "id_influxvars": 8,
      "var_name": "Cloro Residual",
      "condition": "entre",
      "value": 0.5,
      "value2": 1.5,
      "repeatInterval": 30,
      "status": true,
      "hasTimeRange": false,
      "startime": null,
      "endtime": null
    },
    {
      "id": 3,
      "name": "Condición Crítica Filtros",
      "type": "combined",
      "id_influxvars": 15,
      "var_name": "Presión Diferencial",
      "condition": ">",
      "value": 2.0,
      "value2": null,
      "logicOperator": "AND",
      "secondaryVariableId": 16,
      "secondaryVarName": "Caudal Filtros",
      "secondaryCondition": "<",
      "secondaryValue": 100,
      "repeatInterval": 10,
      "status": true,
      "hasTimeRange": false,
      "startime": null,
      "endtime": null
    }
  ]
}
id
integer
Unique alarm identifier
name
string
Alarm display name
type
string
Alarm type: single or combined
id_influxvars
integer
Primary variable ID being monitored
var_name
string
Primary variable name
condition
string
Comparison operator: >, <, =, >=, <=, entre
value
number
Threshold value or lower bound (for “entre”)
value2
number
Upper bound value (only for “entre” condition)
repeatInterval
integer
Minutes between alarm notifications
status
boolean
Whether the alarm is active
hasTimeRange
boolean
Whether the alarm is restricted to specific hours
startime
string
Start time (HH:MM format) if hasTimeRange is true
endtime
string
End time (HH:MM format) if hasTimeRange is true
logicOperator
string
Logical operator for combined alarms: AND or OR
secondaryVariableId
integer
Secondary variable ID (combined alarms only)
secondaryCondition
string
Secondary condition operator (combined alarms only)
secondaryValue
number
Secondary threshold value (combined alarms only)

Create Alarm

Create a new alarm:

Simple Alarm

cURL
curl -X POST "https://masagua.cooptech.com.ar/api/createAlarm" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pH Bajo",
    "type": "single",
    "id_influxvars": 7,
    "condition": "<",
    "value": 6.5,
    "repeatInterval": 20
  }'

Alarm with Time Range

cURL
curl -X POST "https://masagua.cooptech.com.ar/api/createAlarm" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Presión Nocturna Alta",
    "type": "single",
    "id_influxvars": 12,
    "condition": ">",
    "value": 4.0,
    "repeatInterval": 30,
    "hasTimeRange": true,
    "startime": "22:00",
    "endtime": "06:00"
  }'

Range Alarm (Between)

cURL
curl -X POST "https://masagua.cooptech.com.ar/api/createAlarm" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Temperatura Fuera de Rango",
    "type": "single",
    "id_influxvars": 22,
    "condition": "entre",
    "value": 15,
    "value2": 25,
    "repeatInterval": 15
  }'
For “entre” (between) condition, the alarm triggers when the value is outside the specified range.

Combined Alarm

cURL
curl -X POST "https://masagua.cooptech.com.ar/api/createAlarm" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sistema Sobrecarga",
    "type": "combined",
    "id_influxvars": 18,
    "condition": ">",
    "value": 80,
    "logicOperator": "AND",
    "secondaryVariableId": 19,
    "secondaryCondition": ">",
    "secondaryValue": 5.0,
    "repeatInterval": 5
  }'
name
string
required
Alarm name
type
string
required
single or combined
id_influxvars
integer
required
Primary variable ID
condition
string
required
Operator: >, <, =, >=, <=, or entre
value
number
required
Threshold value
value2
number
Upper bound (required for “entre” condition)
repeatInterval
integer
required
Minutes between notifications
hasTimeRange
boolean
Enable time-based restriction (default: false)
startime
string
Start time in HH:MM format (required if hasTimeRange is true)
endtime
string
End time in HH:MM format (required if hasTimeRange is true)
logicOperator
string
AND or OR (required for combined alarms)
secondaryVariableId
integer
Secondary variable ID (required for combined alarms)
secondaryCondition
string
Secondary operator (required for combined alarms)
secondaryValue
number
Secondary threshold (required for combined alarms)

Update Alarm

Update an existing alarm:
cURL
curl -X PUT "https://masagua.cooptech.com.ar/api/updateAlarm/{id}" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pH Bajo Actualizado",
    "type": "single",
    "id_influxvars": 7,
    "condition": "<",
    "value": 6.0,
    "repeatInterval": 15
  }'

Change Alarm Status

Activate or deactivate an alarm:
cURL
curl -X PUT "https://masagua.cooptech.com.ar/api/changeStatusAlarm" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 1,
    "status": true
  }'
id
integer
required
Alarm ID
status
boolean
required
Current status (will be toggled)
The API toggles the status, so if status is true, the alarm will be deactivated.

Alarm Conditions

Available Operators

{
  "condition": ">",
  "value": 5.0
}
Triggers when variable > 5.0

Time-Based Restrictions

Alarms can be restricted to specific time windows:
{
  "hasTimeRange": true,
  "startime": "08:00",
  "endtime": "18:00"
}
This alarm will only trigger between 8:00 AM and 6:00 PM.

Repeat Intervals

The repeatInterval (in minutes) controls notification frequency:
  • 5 minutes: Critical alarms requiring immediate attention
  • 15 minutes: Important operational alerts
  • 30 minutes: Standard monitoring alerts
  • 60+ minutes: Low-priority notifications

Combined Alarm Logic

AND Logic

Both conditions must be true:
{
  "type": "combined",
  "condition": ">",
  "value": 100,
  "logicOperator": "AND",
  "secondaryCondition": "<",
  "secondaryValue": 2.0
}
Triggers when: (Primary > 100) AND (Secondary < 2.0)

OR Logic

Either condition can be true:
{
  "type": "combined",
  "condition": ">",
  "value": 90,
  "logicOperator": "OR",
  "secondaryCondition": ">",
  "secondaryValue": 30
}
Triggers when: (Primary > 90) OR (Secondary > 30)

Example Use Cases

High Pressure Alert

{
  "name": "Presión Crítica Red Principal",
  "type": "single",
  "id_influxvars": 45,
  "condition": ">=",
  "value": 6.0,
  "repeatInterval": 5
}

Water Quality Range

{
  "name": "Cloro Residual Fuera de Norma",
  "type": "single",
  "id_influxvars": 8,
  "condition": "entre",
  "value": 0.2,
  "value2": 2.0,
  "repeatInterval": 20
}

Pump Failure Detection

{
  "name": "Falla Bomba Principal",
  "type": "combined",
  "id_influxvars": 52,
  "condition": "=",
  "value": 0,
  "logicOperator": "AND",
  "secondaryVariableId": 53,
  "secondaryCondition": "<",
  "secondaryValue": 10,
  "repeatInterval": 10
}

Next Steps

Variables

Configure variables for alarms

Charts

Visualize alarm conditions

Build docs developers (and LLMs) love