GetVariables

Reads device model variables. Replaces 1.6's GetConfiguration.

Version
OCPP 2.0.1
Direction
CSMS → Charge Point
Functional block
Provisioning

The read counterpart to SetVariables, addressed the same way. Unlike 1.6's GetConfiguration there is no 'return everything' form — enumerating a station's device model is GetBaseReport's job.

Request

FieldTypeRequiredDescription
getVariableDataGetVariableDataType[]RequiredOne entry per variable: component, variable, and an optional attributeType.
json
[2, "19223201", "GetVariables", {
  "getVariableData": [{
    "component": { "name": "OCPPCommCtrlr" },
    "variable": { "name": "HeartbeatInterval" }
  }]
}]

Response

FieldTypeRequiredDescription
getVariableResultGetVariableResultType[]RequiredOne result per requested variable, each with attributeStatus and attributeValue.
json
[3, "19223201", {
  "getVariableResult": [{
    "attributeStatus": "Accepted",
    "attributeValue": "300",
    "component": { "name": "OCPPCommCtrlr" },
    "variable": { "name": "HeartbeatInterval" }
  }]
}]

Values

GetVariableStatusEnumType

ValueMeaning
AcceptedRead successfully.
RejectedThe read was refused.
UnknownComponentNo such component.
UnknownVariableNo such variable on that component.
NotSupportedAttributeTypeThat attribute type is not supported for this variable.

Implementation notes

There is no way to ask for everything here. Use GetBaseReport with reportBase: "FullInventory" to discover what a station has.

ItemsPerMessageGetVariables on the DeviceDataCtrlr component limits how many variables fit in one request. Read it before sending large batches.