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 Name | Field Type | Card. | Description |
|---|---|---|---|
| getVariableData | GetVariableDataType | 1..* | Required. List of requested variables. |
| Field Name | Field Type | Card. | Description |
|---|---|---|---|
| getVariableResult | GetVariableResultType | 1..* | Required. List of requested variables and their values. |
GetVariableDataType
| Field | Type | Card. | Description |
|---|---|---|---|
| attributeType | AttributeEnumType | 0..1 | Optional. Actual (default), Target, MinSet, MaxSet. |
| component | ComponentType | 1..1 | Component for which the variable is requested. |
| variable | VariableType | 1..1 | Variable being requested. |
GetVariableResultType (selected fields)
| Field | Type | Card. | Description |
|---|---|---|---|
| attributeStatus | GetVariableStatusEnumType | 1..1 | Accepted / Rejected / UnknownComponent / UnknownVariable / NotSupportedAttributeType. |
| attributeType | AttributeEnumType | 0..1 | Default Actual. |
| attributeValue | string [0..2500] | 0..1 | Value (only when attributeStatus = Accepted). |
| component | ComponentType | 1..1 | Component this result applies to. |
| variable | VariableType | 1..1 | Variable this result applies to. |
Examples
{
"getVariableData": [
{ "component": { "name": "OCPPCommCtrlr" }, "variable": { "name": "HeartbeatInterval" } },
{ "component": { "name": "EVSE", "evse": { "id": 1 } }, "variable": { "name": "AvailabilityState" } }
]
}{
"getVariableResult": [
{
"attributeStatus": "Accepted",
"attributeValue": "300",
"component": { "name": "OCPPCommCtrlr" },
"variable": { "name": "HeartbeatInterval" }
},
{
"attributeStatus": "Accepted",
"attributeValue": "Available",
"component": { "name": "EVSE", "evse": { "id": 1 } },
"variable": { "name": "AvailabilityState" }
}
]
}Schema
Source:
schemas/GetVariablesRequest.json,schemas/GetVariablesResponse.json(OCPP 2.0.1 FINAL)