Skip to content
Documentation Menu

Get Variables

Source: OCPP 2.0.1 Part 2 — Specification (Edition 2, 2022-12-15) — Section 1.28 (Messages); Use Case B06 — Get Variables (Functional Block B. Provisioning)

Overview

The CSMS sends GetVariablesRequest to read one or more Device Model Variables synchronously. The response contains the result for each requested variable: actual/target/min/max value, attribute type, and a per-variable status.

Unlike GetBaseReport / GetReport, this is a direct read with the values returned in the response — no NotifyReport follow-up.

Sequence Diagram

CSMS  ──── GetVariablesRequest ────▶  Charging Station
            (getVariableData[])
CSMS  ◀─── GetVariablesResponse ────  Charging Station
            (getVariableResult[])

Initiator

CSMS → Charging Station

Fields

Field NameField TypeCard.Description
getVariableDataGetVariableDataType1..*Required. List of requested variables.

GetVariableDataType

FieldTypeCard.Description
attributeTypeAttributeEnumType0..1Optional. Actual (default), Target, MinSet, MaxSet.
componentComponentType1..1Component for which the variable is requested.
variableVariableType1..1Variable being requested.

GetVariableResultType (selected fields)

FieldTypeCard.Description
attributeStatusGetVariableStatusEnumType1..1Accepted / Rejected / UnknownComponent / UnknownVariable / NotSupportedAttributeType.
attributeTypeAttributeEnumType0..1Default Actual.
attributeValuestring [0..2500]0..1Value (only when attributeStatus = Accepted).
componentComponentType1..1Component this result applies to.
variableVariableType1..1Variable this result applies to.

Examples

{
  "getVariableData": [
    { "component": { "name": "OCPPCommCtrlr" }, "variable": { "name": "HeartbeatInterval" } },
    { "component": { "name": "EVSE", "evse": { "id": 1 } }, "variable": { "name": "AvailabilityState" } }
  ]
}

Schema

Source: schemas/GetVariablesRequest.json, schemas/GetVariablesResponse.json (OCPP 2.0.1 FINAL)

Request schema (JSON Schema)
Response schema (JSON Schema)