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 -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
}
]
}
Alarm type: single or combined
Primary variable ID being monitored
Comparison operator: >, <, =, >=, <=, entre
Threshold value or lower bound (for “entre”)
Upper bound value (only for “entre” condition)
Minutes between alarm notifications
Whether the alarm is active
Whether the alarm is restricted to specific hours
Start time (HH:MM format) if hasTimeRange is true
End time (HH:MM format) if hasTimeRange is true
Logical operator for combined alarms: AND or OR
Secondary variable ID (combined alarms only)
Secondary condition operator (combined alarms only)
Secondary threshold value (combined alarms only)
Create Alarm
Create a new alarm:
Simple Alarm
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 -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 -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 -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
}'
Operator: >, <, =, >=, <=, or entre
Upper bound (required for “entre” condition)
Minutes between notifications
Enable time-based restriction (default: false)
Start time in HH:MM format (required if hasTimeRange is true)
End time in HH:MM format (required if hasTimeRange is true)
AND or OR (required for combined alarms)
Secondary variable ID (required for combined alarms)
Secondary operator (required for combined alarms)
Secondary threshold (required for combined alarms)
Update Alarm
Update an existing alarm:
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 -X PUT "https://masagua.cooptech.com.ar/api/changeStatusAlarm" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"status": true
}'
Current status (will be toggled)
The API toggles the status, so if status is true, the alarm will be deactivated.
Alarm Conditions
Available Operators
Greater Than
Less Than
Equal
Between
{
"condition" : ">" ,
"value" : 5.0
}
Triggers when variable > 5.0 {
"condition" : "<" ,
"value" : 2.0
}
Triggers when variable < 2.0 {
"condition" : "=" ,
"value" : 1
}
Triggers when variable = 1 {
"condition" : "entre" ,
"value" : 6.5 ,
"value2" : 8.5
}
Triggers when variable < 6.5 OR variable > 8.5
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