OCPP 2.1 Testing
What is OCPP 2.1 testing?
OCPP 2.1 testing addresses the forward-looking specification published by the Open Charge Alliance (OCA). It expands beyond OCPP 2.0.1 with bidirectional charging (ISO 15118-20 V2G/V2X, controlled through operationMode and setpoints in charging schedules), local tariffs that the CSMS sends with SetDefaultTariff and ChangeTransactionTariff (functional block I, Tariff and Cost), Distributed Energy Resource (DER) control, Automated Frequency Restoration Reserve (AFRR) support, and battery swap station management.
Last reviewed
Supported modules and flows
- Bidirectional power transfer and Vehicle-to-Grid (V2G / V2X) ISO 15118-20 message sequences.
- Local tariffs with SetDefaultTariff and ChangeTransactionTariff, plus running cost in TransactionEvent costDetails.
- Distributed Energy Resource (DER) integration and grid frequency regulation (AFRR).
- Battery swap station workflows (BatterySwap) and extended charging profile schedules.
Best for
- Engineering teams planning architecture migrations from OCPP 2.0.1 to OCPP 2.1.
- Energy aggregators and utility platforms building V2G, V2X, and grid-responsive charging services.
- Hardware and CSMS vendors validating forward-looking schema conformance against OCA 2.1 specifications.
Example OCPP 2.1 dynamic tariff & V2G flow
The CSMS sets a default tariff, changes the tariff of a running transaction, then asks the EV to discharge with a TxProfile whose schedule period uses operationMode CentralSetpoint and a negative setpoint.
Charge point -> CSMS: BootNotificationRequest {reason: PowerUp, chargingStation: {vendorName, model}}
CSMS -> Charge point: BootNotificationResponse {status: Accepted}
CSMS -> Charge point: SetDefaultTariffRequest {evseId: 1, tariff: {tariffId: "T-DYN-1", currency: "EUR", energy: {prices: [{priceKwh: 0.32}]}}}
Charge point -> CSMS: SetDefaultTariffResponse {status: Accepted}
Charge point -> CSMS: TransactionEventRequest {eventType: Started, triggerReason: CablePluggedIn, seqNo: 0, timestamp,
transactionInfo: {transactionId: "tx-21", chargingState: EVConnected}}
CSMS -> Charge point: TransactionEventResponse
CSMS -> Charge point: ChangeTransactionTariffRequest {transactionId: "tx-21", tariff: {tariffId: "T-PEAK-2", currency: "EUR", energy: {prices: [{priceKwh: 0.45}]}}}
Charge point -> CSMS: ChangeTransactionTariffResponse {status: Accepted}
CSMS -> Charge point: SetChargingProfileRequest {evseId: 1, chargingProfile: {chargingProfilePurpose: TxProfile, transactionId: "tx-21",
chargingSchedule: [{chargingRateUnit: W, chargingSchedulePeriod: [{startPeriod: 0, operationMode: CentralSetpoint, setpoint: -7000}]}]}}
Charge point -> CSMS: SetChargingProfileResponse {status: Accepted}
Charge point -> CSMS: TransactionEventRequest {eventType: Updated, triggerReason: OperationModeChanged, seqNo: 1, timestamp,
transactionInfo: {transactionId: "tx-21", chargingState: Charging, operationMode: CentralSetpoint},
meterValue: [{timestamp, sampledValue: [{measurand: Energy.Active.Export.Register, value: 400}]}]}
CSMS -> Charge point: TransactionEventResponseOCPP 2.1 coverage in the workspace
OCPP 2.1 adds V2G, dynamic tariffs, DER, AFRR, and BatterySwap. The workspace covers those message sequences with schema checks and virtual chargers.
Bidirectional V2G & V2X
- Charging schedule periods with operationMode, setpoint, and dischargeLimit
- Validate discharge setpoints and the OperationModeChanged TransactionEvent that follows.
Dynamic Tariffs & Cost Calculation
- SetDefaultTariff, ChangeTransactionTariff, GetTariffs, and ClearTariffs
- Verify tariff acceptance, TariffChanged events, and costDetails during active sessions.
DER & Grid Support
- SetDERControl, AFRRSignal, and BatterySwap message sequences
- Check that the CSMS sends the right DER and AFRR requests and handles the responses.
| Profile | Coverage | Typical validation |
|---|---|---|
| Bidirectional V2G & V2X | Charging schedule periods with operationMode, setpoint, and dischargeLimit | Validate discharge setpoints and the OperationModeChanged TransactionEvent that follows. |
| Dynamic Tariffs & Cost Calculation | SetDefaultTariff, ChangeTransactionTariff, GetTariffs, and ClearTariffs | Verify tariff acceptance, TariffChanged events, and costDetails during active sessions. |
| DER & Grid Support | SetDERControl, AFRRSignal, and BatterySwap message sequences | Check that the CSMS sends the right DER and AFRR requests and handles the responses. |
What to test
- V2G and V2X bidirectional power flow message sequencing.
- Tariff and Cost (functional block I): local tariffs and session cost reporting.
- DER control and AFRR grid reserve response behavior.
- Forward-looking OCPP 2.1 JSON schema validation.
Common scenarios
V2G & grid stabilization
Simulate electric vehicles injecting stored battery power back into commercial microgrids during peak tariff hours.
Dynamic pricing verification
Validate that the CSMS accurately pushes dynamic price tables and verifies driver display cost computations.
Specification migration readiness
Audit existing 2.0.1 data models and identify field delta requirements before deploying 2.1 firmware.
Related resources
Explore OCPP 2.1 workflows for V2G and DER charging
Model bidirectional V2G flows, dynamic tariffs, and prepare your CSMS architecture for the next era of EV charging.