{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ruter.no/adt/ota/api/v4.x/sensors/energy-consumption/energy-consumption.json",
  "type": "object",
  "title": "EnergyConsumption",
  "description": "Schema for energy consumption sensor data. The value represents accumulated energy consumption in kilowatt-hours (kWh), including all onboard systems such as HVAC. The value should always accumulate over time.",
  "required": [
    "eventTimestamp",
    "traceId",
    "messageNumber",
    "sensorId",
    "value"
  ],
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "ISO 8601 timestamp in UTC (must end with 'Z'), indicating when the measurement was taken",
      "example": "2025-05-13T12:00:00.000Z"
    },
    "traceId": {
      "$id": "#/properties/traceId",
      "type": "string",
      "description": "Unique identifier for tracing this message",
      "example": "baf3d8ac-1234-4e0c-9e9e-abc123def456"
    },
    "messageNumber": {
      "$id": "#/properties/messageNumber",
      "type": "integer",
      "description": "Sequence number, increased by one for each new message",
      "example": 27
    },
    "sensorId": {
      "$id": "#/properties/sensorId",
      "type": "string",
      "description": "Unique identifier for the sensor. Typically the serial number (S/N) from the sensor.",
      "example": "SN-456789"
    },
    "value": {
      "$id": "#/properties/value",
      "type": "number",
      "description": "Accumulated energy consumption, including HVAC systems, measured in kilowatt-hours (kWh)",
      "example": 1287.45
    }
  },
  "additionalProperties": true
}