Set Variables
Source: OCPP 2.0.1 Part 2 — Specification (Edition 2, 2022-12-15) — Section 1.57 (Messages); Use Case B05 — Set Variables (Functional Block B. Provisioning)
Overview
The CSMS sends SetVariablesRequest to write one or more Device Model variable attributes synchronously. The Charging Station returns one SetVariableResultType per variable, indicating success/failure and optionally whether a reboot is required.
This is the OCPP 2.0.1 replacement for the OCPP 1.6 ChangeConfiguration mechanism.
Sequence Diagram
CSMS ──── SetVariablesRequest ────▶ Charging Station
(setVariableData[])
CSMS ◀─── SetVariablesResponse ──── Charging Station
(setVariableResult[])
Initiator
CSMS → Charging Station
Fields
| Field Name | Field Type | Card. | Description |
|---|---|---|---|
| setVariableData | SetVariableDataType | 1..* | Required. List of Component-Variable pairs and attribute values to set. |
| Field Name | Field Type | Card. | Description |
|---|---|---|---|
| setVariableResult | SetVariableResultType | 1..* | Required. Result status per Component-Variable. |
SetVariableDataType
| Field | Type | Card. | Description |
|---|---|---|---|
| attributeType | AttributeEnumType | 0..1 | Optional. Default Actual. Other: Target, MinSet, MaxSet. |
| attributeValue | string [0..1000] | 1..1 | Required. New value as string. |
| component | ComponentType | 1..1 | Component to which the variable belongs. |
| variable | VariableType | 1..1 | Variable to be set. |
SetVariableResultType (selected fields)
| Field | Type | Card. | Description |
|---|---|---|---|
| attributeStatus | SetVariableStatusEnumType | 1..1 | Accepted / Rejected / RebootRequired / UnknownComponent / UnknownVariable / NotSupportedAttributeType. |
| attributeType | AttributeEnumType | 0..1 | Default Actual. |
| component | ComponentType | 1..1 | Component this result applies to. |
| variable | VariableType | 1..1 | Variable this result applies to. |
SetVariableStatusEnumType values
Accepted, Rejected, RebootRequired, UnknownComponent, UnknownVariable, NotSupportedAttributeType.
Examples
{
"setVariableData": [
{
"attributeValue": "300",
"component": { "name": "OCPPCommCtrlr" },
"variable": { "name": "HeartbeatInterval" }
}
]
}{
"setVariableResult": [
{
"attributeStatus": "Accepted",
"component": { "name": "OCPPCommCtrlr" },
"variable": { "name": "HeartbeatInterval" }
}
]
}Schema
Source:
schemas/SetVariablesRequest.json,schemas/SetVariablesResponse.json(OCPP 2.0.1 FINAL)