Skip to content
Documentation Menu

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 NameField TypeCard.Description
setVariableDataSetVariableDataType1..*Required. List of Component-Variable pairs and attribute values to set.

SetVariableDataType

FieldTypeCard.Description
attributeTypeAttributeEnumType0..1Optional. Default Actual. Other: Target, MinSet, MaxSet.
attributeValuestring [0..1000]1..1Required. New value as string.
componentComponentType1..1Component to which the variable belongs.
variableVariableType1..1Variable to be set.

SetVariableResultType (selected fields)

FieldTypeCard.Description
attributeStatusSetVariableStatusEnumType1..1Accepted / Rejected / RebootRequired / UnknownComponent / UnknownVariable / NotSupportedAttributeType.
attributeTypeAttributeEnumType0..1Default Actual.
componentComponentType1..1Component this result applies to.
variableVariableType1..1Variable this result applies to.

SetVariableStatusEnumType values

Accepted, Rejected, RebootRequired, UnknownComponent, UnknownVariable, NotSupportedAttributeType.

Examples

{
  "setVariableData": [
    {
      "attributeValue": "300",
      "component": { "name": "OCPPCommCtrlr" },
      "variable": { "name": "HeartbeatInterval" }
    }
  ]
}

Schema

Source: schemas/SetVariablesRequest.json, schemas/SetVariablesResponse.json (OCPP 2.0.1 FINAL)

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