Getting Current and recent alarms
Request
GET /alarmsState/{alarmOutputId}/?accessKey={accessKey}
Parameters
{alarmOutputId} - any of the configured Api Outputs. Alarm monitor uses id monitor {accessKey} - any of the configured Access Keys
Response
{ "currentDate":"2023-12-15T15:33:48.679+01:00", "alarmLines":{ "id1":{ "title":"2.4 PCR_accuracy_error (TR290)", "alarm":"4228", "alarmSince":"2023-12-15T15:33:42.679+01:00", "stationId":"tvp1 type:ts source:udp://@230.0.1.1:1111 ei:0", "stationName":"tvp1" }, "id2":{ "title":"TS Continuity Error", "alarm":"0", "alarmSince":"never", "stationId":"tvp1 type:ts source:udp://@230.0.1.1:1111 ei:0", "stationName":"tvp1" }, } }
CurrentDate
Timestamp of the response in ISO 8601 format.
AlarmLines
Map of all configured alarms lines, both active and inactive.
Title
Human-readable name of an alarm line
Alarm
Unique id of an alarm or 0 if the alarm line is inactive
AlarmSince
Timestamp when the alarm line changed its state to either active or inactive. Uses ISO 8601 format or ”never”
StationId
Unique id of the station owning the alarm line
StationName
Configured name of the station owning the alarm line
Description
Alarms state contains a list of all alarms lines of all stations. Each alarm line can be active or inactive. Active alarm line means that there is currently an alarm. In this case the alarm field has a unique value of this alarm and from the difference between alarmSince and currentDate we can tell for how long this alarm is going on. Alarm line with the alarm field set to 0 has no current alarm but it may have a recent one. The alarmSince field tells when it had the last moment of activity.
Error codes
Error Invalid access Key
Response status: 400
Response body:
{ "error":"NO_SESSION" }
Reason
Invalid {accessKey}
Error Invalid Alarm Output Id
Response status: 404
Response body:
{ "error":"NOT_FOUND" }
Reason
Invalid {alarmOutputId}