# Warm Path Data Schemas

Each message type for the warm path /data/<type> API endpoints has a specific format that must be followed for the data to be properly ingested by the platform without error. Each message type is sent from a device to the cloud.

The supported message types are:

  • timeSeries
  • event
  • alarm
  • platformEvent

NOTE

A simple json schema validator can be used to confirm json validity for each telemetry type.

# timeSeries Type

# Example 1 - Single Variable

{
    "objectId": "2e57962f-2b6c-43c0-8fd8-c0d50d140011",
    "model": "abb.ability.device",
    "timestamp": "2018-05-01T15:12:09.473Z",
    "variable": "brokenRotorIndex",
    "value": 5
}

# Example 2 - Batch Variables

Events can be sent on behalf of multiple objects.

[
  {
   "objectId": "2e57962f-2b6c-43c0-8fd8-c0d50d140011",
   "model": "abb.ability.device",
   "timestamp": "2018-05-01T15:12:19.474Z",
   "variable": "kurtosis.x",
   "value": 1.2
  },
  {
   "objectId": "c0b4336b-fa23-4a7f-b92b-d971d8b041cd",
   "model": "abb.ability.device",
   "timestamp": "2018-05-01T15:12:19.476Z",
   "variable": "kurtosis.y",
   "value": 2.5,
   "quality": 0
  }
]

# JSON schema

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "oneOf": [
    {
      "$ref": "#/definitions/event"
    },
    {
      "type": "array",
      "items": {
        "$ref": "#/definitions/event"
      },
      "minItems": 1
    }
  ],
  "definitions": {
    "event": {
      "type": "object",
      "required": [
        "objectId",
        "model",
        "timestamp",
        "variable",
        "value"
      ],
      "additionalProperties": false,
      "properties": {
        "objectId": {
          "description": "Object identifier",
          "type": "string"
        },
        "model": {
          "description": "Model that this variable belongs to",
          "type": "string"
        },
        "timestamp": {
          "description": "Time when this variable value was generated, in ISO 8601 date time format",
          "type": "string",
          "format": "date-time"
        },
        "variable": {
          "description": "Fully qualified variable name as defined in the type definition of this model, i.e. foo.bar",
          "type": "string"
        },
        "value": {
          "description": "Value of the variable (or variable part). Must be either a scalar value or an array of scalar values",
          "oneOf": [
            {
              "type": [
                "integer",
                "number",
                "boolean",
                "string"
              ]
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1
            },
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 1
            },
            {
              "type": "array",
              "items": {
                "type": "boolean"
              },
              "minItems": 1
            }
          ]
        },
        "quality": {
          "description": "Data quality",
          "type": "integer",
          "min": 0
        }
      }
    }
  }
}

# Event

# Example

{
  "objectId": "c0b4336b-fa23-4a7f-b92b-d971d8b041cd",
  "model": "abb.ability.device",
  "timestamp": "2017-11-09T12:34:23.020Z",
  "event" : "motorstarted",
  "value" : {
    "eventCode": "171900",
    "startTime": "2017-11-09T12:30:20.000Z"
  }
}

# JSON schema

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "oneOf": [
    {
      "$ref": "#/definitions/event"
    },
    {
     "type": "array",
     "items": {
       "$ref": "#/definitions/event"
     },
     "minItems": 1
    }
  ],
  "definitions": {
    "event": {
      "type": "object",
      "required": [
        "objectId",
        "model",
        "timestamp",
        "event",
        "value"
      ],
      "properties": {
        "objectId": {
          "description": "Object identifier",
          "type": "string"
        },
        "model": {
          "description": "Model that this event belongs to",
          "type": "string"
        },
        "timestamp": {
          "description": "Time when this event was generated, in ISO 8601 date-time format",
          "type": "string",
          "format": "date-time"
        },
        "event": {
          "description": "Event name as defined in the type definition of this model, i.e. event123",
          "type": "string"
        },
        "value": {
          "description": "Payload for this event. Must be an object.",
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": [
                  "integer",
                  "number",
                  "boolean",
                  "string"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": [
                    "integer",
                    "number",
                    "boolean",
                    "string"
                  ]
                }
              }
            ]
          }
        },
        "quality": {
          "description": "Data quality",
          "type": "integer",
          "min": 0
        }
      }
    }
  }
}

# Alarm

# Example

{
  "objectId": "c0b4336b-fa23-4a7f-b92b-d971d8b041cd",
  "model": "abb.ability.device",
  "timestamp": "2017-11-09T12:34:23.020Z",
  "alarm" : "motorTempHigh",
  "alarmKey": "alarms.variables.mainComputer.fans.right",
  "value" : {
    "alarmCode": "171901",
    "limit": 10
  }
}

# JSON schema

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "oneOf": [
    {
      "$ref": "#/definitions/event"
    },
    {
     "type": "array",
     "items": {
       "$ref": "#/definitions/event"
     },
     "minItems": 1
    }
  ],
  "definitions": {
    "event": {
      "type": "object",
      "required": [
        "objectId",
        "model",
        "timestamp",
        "alarm",
        "value"
      ],
      "additionalProperties": false,
      "properties": {
        "objectId": {
          "description": "Object identifier",
          "type": "string"
        },
        "model": {
          "description": "Model that this alarm belongs to",
          "type": "string"
        },
        "timestamp": {
          "description": "Time when this alarm was raised, in ISO 8601 date-time format",
          "type": "string",
          "format": "date-time"
        },
        "alarm": {
          "description": "Alarm name as defined in the type definition of this model, i.e. event123",
          "type": "string"
        },
        "alarmKey": {
          "description": "Key used to identify uniqueness of alarm",
          "type": "string"
        },
        "value": {
          "description": "Payload for this alarm. Must be an object.",
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": [
                  "integer",
                  "number",
                  "boolean",
                  "string"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": [
                    "integer",
                    "number",
                    "boolean",
                    "string"
                  ]
                }
              }
            ]
          }
        },
        "quality": {
          "description": "Data quality",
          "type": "integer",
          "min": 0
        }
      }
    }
  }
}
Last updated: 9/6/2021, 1:25:50 PM
Feedback