This real-time api provides an endpoint for users to subscribe to the alarm and measurements messages. The messages were buffered in a queue when users disconnected from the server and will be retrived once reconnected.
Any error condition (failed authentication, rate limiting, subscription refused, or an unexpected server-side error) is reported to the client as a STOMP ERROR frame - see components.schemas.StompErrorFrame below. After sending an ERROR frame the server closes the WebSocket connection, per the STOMP protocol.
Known ERROR frame scenarios on this server:
invalid authorization. - Rate limited - too many parallel connections - message: Maximum parallel connection limit exceeded. Please close other connections., header
error-code: max-connections-reached.Too many connection attempts. Please wait {ms} ms before retrying., header error-code: rate-limit-exceeded.subscription refused: missing required permission or license for queue: {queue},
header queue: {queue}.Unable to process the request. The real cause is logged server-side only and never
included in the frame sent to the client.Subscribe to this channel to receive the alarm message. NOTE that the username must match the username you used while acquring the token!
Available only on servers:
Accepts one of the following messages:
{
"uuid": "b107fe58-6e2d-4f18-bae6-767e2a30c9c7",
"tenant_uuid": "f9a86182-3b41-4964-1111-149f083b11d6",
"alarm_reason": "Alarm condition is violated",
"alarm_status": "Alarm",
"last_status_change_time": "2023-04-29T01:35:37Z",
"alarm_condition_type": "Upper limit",
"alarm_severity": "Warning",
"alarm_time": "2023-04-29T06:25:00Z",
"alarm_time_local": "2023-04-29T08:25:00+02:00",
"serial_number": "56000000",
"alarm_source_uuid": "f1aa6496-abe8-4920-1111-7ee5f529a321",
"alarm_type": "measurement alarm",
"processed_at": "2023-04-29T06:27:25Z",
"alarm_delay": "300000",
"alarm_value": "22.015625",
"physical_unit": "°C",
"physical_value": "Temperature",
"physical_value_extension": "Air Temperature"
}
{
"content-length": "832",
"timestamp": "1682749648090",
"content-type": "application/json",
"message-id": "cb-4d60f416-7083-406c-9476-6d166c21bf72-1-39009-1682707981501-3",
"priority": "4",
"subscription": "sub-0",
"destination": "/queue/username/alarms",
"expires": "0"
}
device/sensor system alarm event
Detailed information about the alarm.
{
"uuid": "b107fe58-6e2d-4f18-bae6-767e2a30c9c7",
"tenant_uuid": "f9a86182-3b41-4964-1111-149f083b11d6",
"alarm_reason": "Alarm condition is violated",
"alarm_status": "Alarm",
"last_status_change_time": "2023-04-29T01:35:37Z",
"alarm_condition_type": "Upper limit",
"alarm_severity": "Warning",
"alarm_time": "2023-04-29T06:25:00Z",
"alarm_time_local": "2023-04-29T08:25:00+02:00",
"serial_number": "56000000",
"alarm_source_uuid": "f1aa6496-abe8-4920-1111-7ee5f529a321",
"alarm_type": "measurement alarm",
"processed_at": "2023-04-29T06:27:25Z"
}
{
"content-length": "832",
"timestamp": "1682749648090",
"content-type": "application/json",
"message-id": "cb-4d60f416-7083-406c-9476-6d166c21bf72-1-39009-1682707981501-3",
"priority": "4",
"subscription": "sub-0",
"destination": "/queue/username/alarms",
"expires": "0"
}
Note: This channel will be deprecated in the near future. Please use /queue/username/measurements-v2 instead.
Subscribe to this channel to receive the measurements message. NOTE that the username must match the username you used while acquring the token!
Available only on servers:
Accepts the following message:
measurements
Detailed information about the measurements.
{
"uuid": "8b83c3c4-4a88-45c4-a9ed-87bda598fd8d",
"device_uuid": "6b492662-002a-4b35-95d4-466264122290",
"sensor_uuid": "6a081512-efbf-4de1-995f-79959989abce",
"channel_id": 1913253106,
"device_serial_no": "54769221",
"sensor_serial_no": "56000670",
"tenant_uuid": "f9a86182-3b41-4964-1111-149f083b11d6",
"timestamp": "2023-04-29T06:25:00Z",
"timestamp_local": "2023-04-29T08:25:00+02:00",
"measurement": 21.796875,
"physical_property_name": "Temperature",
"physical_unit": "°C",
"physical_extension": "Air Temperature",
"processed_at": "2023-04-29T06:27:25Z"
}
{
"content-length": "832",
"timestamp": "1682749648090",
"content-type": "application/json",
"message-id": "cb-4d60f416-7083-406c-9476-6d166c21bf72-1-39009-1682707981501-3",
"priority": "4",
"subscription": "sub-0",
"destination": "/queue/username/alarms",
"expires": "0"
}
Subscribe to this channel to receive measurements in the v2 format (MeasurementOutputMessage). Only active after a version switch has been scheduled via the version-settings API. NOTE that the username must match the username you used while acquiring the token!
Available only on servers:
Accepts the following message:
measurements v2
Detailed information about the measurements (v2 format).
{
"uuid": "8b83c3c4-4a88-45c4-a9ed-87bda598fd8d",
"customer_site": "site-42",
"tenant_uuid": "f9a86182-3b41-4964-1111-149f083b11d6",
"sensor_uuid": "6a081512-efbf-4de1-995f-79959989abce",
"channel_no": 1,
"physical_property_name": "Temperature",
"physical_extension": "Air Temperature",
"physical_unit": "°C",
"timestamp": "2023-04-29T06:25:00Z",
"timestamp_local": "2023-04-29T08:25:00+02:00",
"measurement": 21.796875,
"serial_no": "54769221",
"model_code": "0572 0001",
"processed_at": "2023-04-29T06:27:25Z"
}
{
"content-length": "832",
"timestamp": "1682749648090",
"content-type": "application/json",
"message-id": "cb-4d60f416-7083-406c-9476-6d166c21bf72-1-39009-1682707981501-3",
"priority": "4",
"subscription": "sub-0",
"destination": "/queue/username/alarms",
"expires": "0"
}
device/sensor system alarm event
Detailed information about the alarm.
measurements
Detailed information about the measurements.
measurements v2
Detailed information about the measurements (v2 format).
Shape of every STOMP ERROR frame sent by this server. See the "Errors" section above for the concrete scenarios and their message/header values. The connection is closed immediately after this frame is sent.
fields that only exist in measurement alarm type
Detailed information about the measurements.
Detailed information about the measurements (v2 format).