Alert Data Format

This structure is attached to HTTP, MQTT event outputs in addition to the user defined message body.

The data format described represents the body of an event in AlphaX. This body captures detailed information about the sensor and device involved, the conditions being monitored, and any AI-generated insights or messages. Here's a detailed explanation of how each field relates to the context of an event.

Event Body Structure

  1.  channelDescription
    •  Context: Describes what the sensor channel measures within the event.
    •  Example: "Measures the distance to the nearest object"
  2.  id
    •  Context: Unique identifier for the sensor, crucial for tracking and managing events related to this specific sensor.
    •  Example: "sensor-001"
  3.  chid
    •  Context: Channel ID for the sensor, helping to identify the specific channel generating the event.
    •  Example: "ch-001"
  4.  netid
    •  Context: Network ID indicating the network segment the sensor is part of, useful for network-related events.
    •  Example: "net-001"
  5.  data
    •  Context: Latest data readings from the sensor, timestamped for chronological tracking.
    •  Fields:
      •  timestamp: When the data was recorded, crucial for event timelines.
        •  Example: "2024-05-30T14:22:00Z"
      •  value: The actual sensor reading at the time of the event.
        •  Example: "23.5"
  6.  deviceName
    •  Context: Name of the device containing the sensor, providing context within the event for which device is involved.
    •  Example: "Bin Sensor Template"
  7.  labelColor
    •  Context: Visual identifier for the sensor label, helping to quickly differentiate between sensors in event logs.
    •  Example: "#FF0000"
  8.  labelName
    •  Context: Name or label of the sensor, aiding in easy identification within the event context.
    •  Example: "Distance Sensor"
  9.  location
    •  Context: General physical location of the device, important for location-based events.
    •  Example: "Warehouse 1"
  10.  locationSensor
    •  Context: Specific location details within a larger area, adding precision to event logs.
    •  Example: "Aisle 5, Shelf 3"
  11.  tag
    •  Context: Tag or identifier for the sensor device, useful for tagging events.
    •  Example: "ZZZ-BINS-001"
  12.  unit
    •  Context: Measurement unit for the sensor data, providing context for the data values in the event.
    •  Example: "cm"
  13.  timezone
    •  Context: Timezone of the sensor’s location, crucial for accurately timing events.
    •  Example: "UTC+10"
  14.  siteid
    •  Context: Identifier for the site where the sensor is located, helping to associate events with specific sites.
    •  Example: "site-001"
  15.  sensorType
    •  Context: Type of sensor, providing context on the nature of the event data.
    •  Example: "Ultrasonic"
  16.  limitData
    •  Context: Data limits for the sensor, used to determine if an event should be triggered based on sensor readings.
    •  Example: "50-100"
  17.  limitOutput
    •  Context: Output limits that define thresholds for triggering events.
    •  Example: "Alert if > 70"
  18.  cal
    •  Context: Calibration settings, used to adjust the sensor data for accurate event generation.
    •  Example: "1.05"
  19.  offset
    •  Context: Offset value applied to the sensor data, used for fine-tuning event triggers.
    •  Example: "0.5"
  20.  maxVal
    •  Context: Maximum allowable value for sensor data to avoid false events.
    •  Example: "100"
  21.  minVal
    •  Context: Minimum allowable value for sensor data to ensure relevant events are triggered.
    •  Example: "10"
  22.  conditions
    •  Context: Specific conditions that are monitored and can trigger events.
    •  Fields
      •  label: Description of the condition.
        •  Example: "High Level"
      •  value: Numerical value for the condition.
        •  Example: 1
      •  condition: The specific condition being monitored that can trigger an event.
        •  Example: "Above Threshold"
  23.  ai
    •  Context: AI-based insights that provide deeper context for the events.
    •  Fields:
      •  rootCauses: Identified root causes for issues, helping to understand the event.
        •  Example: "Bin size is too small, increase size to increase time between fills"
      •  recommendations: Suggested actions based on AI analysis to address the event.
        •  Example: "Schedule an immediate waste collection to prevent overflow"
  24.  message
    •  Context: Messages or notifications related to the event.
    •  Fields:
      • content: The message text providing additional information about the event.
        •  Example: "Sensor needs maintenance"
 
 
Example Event Body JSON
Here’s an example of how an event body might look:
 
[{
    "channelDescription": "Measures the distance to the nearest object",
    "id": "sensor-001",
    "chid": "ch-001",
    "netid": "net-001",
    "data": [
        {"timestamp": "2024-05-30T14:22:00Z", "value": "23.5"}
    ],
    "deviceName": "Bin Sensor Template",
    "labelColor": "#FF0000",
    "labelName": "Distance Sensor",
    "location": "Warehouse 1",
    "locationSensor": "Aisle 5, Shelf 3",
    "tag": "ZZZ-BINS-001",
    "unit": "cm",
    "timezone": "UTC+10",
    "siteid": "site-001",
    "sensorType": "Ultrasonic",
    "limitData": "50-100",
    "limitOutput": "Alert if > 70",
    "cal": "1.05",
    "offset": "0.5",
    "maxVal": "100",
    "minVal": "10",
    "conditions": [
        {"label": "High Level", "value": 1, "condition": "Above Threshold"}
    ],
    "ai": [
        {
        "rootCauses": "Bin size is too small, increase size to increase time between fills", 
        "recommendations": "Schedule an immediate waste collection to prevent overflow"}
    ],
    "message": [
        {"content": "Sensor needs maintenance"}
    ],
}]