SetVariableMonitoring

Monitoring CSMS->CS OCPP 2.0.1

Sent by the CSMS to configure monitors on specific variables. When a monitor triggers, the Charging Station sends a NotifyEvent.

Quick Reference

Required Fields

setMonitoringData array[SetMonitoringDataType]

List of monitoring configurations to set

setMonitoringData[].value number

Threshold value or delta for the monitor

setMonitoringData[].type MonitorEnumType

Monitor type: UpperThreshold, LowerThreshold, Delta, Periodic, PeriodicClockAligned

setMonitoringData[].severity integer

Severity level 0 (Danger) to 9 (Debug)

setMonitoringData[].component ComponentType

Component containing the variable to monitor

setMonitoringData[].variable VariableType

Variable to monitor

Optional Fields

setMonitoringData[].transaction boolean

If true, monitor only during a transaction

setMonitoringData[].id integer

ID to assign to this monitor

Example Payload

{
  "setMonitoringData": [
    {
      "value": 80,
      "type": "UpperThreshold",
      "severity": 3,
      "component": {
        "name": "Connector",
        "evse": {
          "id": 1
        }
      },
      "variable": {
        "name": "Temperature"
      }
    },
    {
      "value": 30,
      "type": "Periodic",
      "severity": 9,
      "component": {
        "name": "EnergyMeter"
      },
      "variable": {
        "name": "Energy.Active.Import.Register"
      }
    }
  ]
}

Example Full Frame

[
  2,
  "msg-001",
  "SetVariableMonitoring",
  {
    "setMonitoringData": [
      {
        "value": 80,
        "type": "UpperThreshold",
        "severity": 3,
        "component": {
          "name": "Connector",
          "evse": {
            "id": 1
          }
        },
        "variable": {
          "name": "Temperature"
        }
      },
      {
        "value": 30,
        "type": "Periodic",
        "severity": 9,
        "component": {
          "name": "EnergyMeter"
        },
        "variable": {
          "name": "Energy.Active.Import.Register"
        }
      }
    ]
  }
]

Format: [MessageType, MessageId, Action, Payload]

Overview

SetVariableMonitoring configures the Charging Station to watch specific variables and report when they cross thresholds, change by a delta, or at regular intervals. This is the foundation of proactive monitoring in OCPP 2.0.1.

When to Send

  • To set up temperature alerts on connectors
  • To configure periodic energy reporting
  • To alert when a variable drops below a minimum threshold

Expected Response

  • setMonitoringResult: Array of results with status per monitor: Accepted, UnknownComponent, UnknownVariable, UnsupportedMonitorType, Rejected, Duplicate

Monitor Types

TypeDescription
UpperThresholdFires when value rises above threshold
LowerThresholdFires when value drops below threshold
DeltaFires when value changes by ≥ specified amount
PeriodicFires at fixed intervals (in seconds)
PeriodicClockAlignedFires at clock-aligned intervals

Testing Tips

  • Set an UpperThreshold on temperature and simulate a high reading — verify NotifyEvent arrives
  • Set a Periodic monitor and verify events arrive at the configured interval
  • Verify Duplicate status when setting a monitor that already exists

Common Errors

TypeConstraintViolation

Cause: type uses an unsupported monitor type

Solution: Use: UpperThreshold, LowerThreshold, Delta, Periodic, or PeriodicClockAligned

PropertyConstraintViolation

Cause: severity is outside the 0-9 range

Solution: severity must be an integer from 0 (most critical) to 9 (debug)