OCPP 2.1 lets a CSMS ask a car to give power back: to a building, a site battery or the grid. For the CSMS that means new messages to answer and new fields to send. Testing them is the hard part, because you need a car and a charger that can both do it. This guide lists what your CSMS has to handle, then shows how to try it with Rey, the free virtual charge point, whose car can give power back to its charger. What’s new in OCPP 2.1 covers the rest of the version.

Rey's Cockpit on OCPP 2.1 while the car gives 11 kW back: the charger screen says DISCHARGING with kWh in and kWh out, Give back is chosen on the car card, which says ISO 15118-20, TLS 1.3, bidirectional, and the conversation shows a schedule renegotiation, NotifyEVChargingSchedule and the DC charge loop giving power back

What has to line up

Giving power back runs over two links, and both have to support it:

  • Car and charger: ISO 15118-20. It defines bidirectional power as its own energy services, DC_BPT and AC_BPT. ISO 15118-20 runs over TLS 1.3, so the charger needs an ISO 15118-20 certificate (P-521 or Ed448). ISO 15118-2 vs ISO 15118-20 (coming soon) explains the differences between the two editions.
  • Charger and CSMS: OCPP 2.1. OCPP 1.6 and 2.0.1 have no messages for bidirectional power. On those versions your CSMS sees only the exported energy and power in the meter values.

What your CSMS sees and sends on OCPP 2.1

On OCPP 2.1 every ISO 15118-20 session tells the CSMS what the car needs and plans, whether it gives power back or not. In the order you meet them:

MessageDirectionWhat your CSMS has to do
allowedEnergyTransfer in the Authorize answerCSMS to chargerInclude DC_BPT or AC_BPT to allow giving power back for this card. Without it, the session is charging only.
NotifyAllowedEnergyTransferCSMS to chargerAllow it later, during the charge, if you didn’t at Authorize.
NotifyEVChargingNeedsCharger to CSMSRead the car’s needs: the energy transfer it asks for, the car’s and the charger’s limits in both directions, and the departure time. Answer Accepted, Processing, NoChargingProfile or Rejected.
SetChargingProfileCSMS to chargerAfter Accepted, send a TxProfile within 30 seconds. Set an operation mode, and a dischargeLimit if you want one.
NotifyEVChargingScheduleCharger to CSMSTake the car’s plan, in scheduled control.
TransactionEvent UpdatedCharger to CSMSTake the update sent when the operation mode changes, with the setpoint measurands the charger is configured to send.
UpdateDynamicScheduleCSMS to chargerFor a Dynamic profile: send a new setpoint.
PullDynamicScheduleUpdateCharger to CSMSFor a Dynamic profile with an update interval: answer the charger when it asks for an update.

Your answer to NotifyEVChargingNeeds decides what happens next. Accepted makes the charger wait up to 30 seconds for your TxProfile. Processing and NoChargingProfile let it go on with the limits it has. Rejected ends the session.

That makes one failure common: a CSMS allows DC_BPT in its Authorize answer, then answers NotifyEVChargingNeeds with Rejected. The car was told it may give power back, and the session ends instead. If your CSMS can’t serve the car’s needs yet, answer Processing or NoChargingProfile and let the charger carry on with the limits it has.

Operation modes

The operation mode in the charging profile says who sets the power:

  • ChargingOnly: the car only charges.
  • CentralSetpoint: your CSMS sets the power with a setpoint. Below zero, the car gives power back.
  • CentralFrequency: the charger adjusts the power to the grid frequency.
  • Idle: no power either way.

A profile without an operation mode means charging only. Send one during a session that gives power back, and the car stops giving it. That’s an easy bug to ship: a CSMS that resends an ordinary limit can switch V2X off without meaning to.

Scheduled or dynamic control

ISO 15118-20 has two ways to share the work:

  • Scheduled control: the charger sends the car a schedule, and the car plans within it. When your profile changes the schedule, the charger asks the car for a new plan (a renegotiation), and the plan comes back to you in NotifyEVChargingSchedule.
  • Dynamic control: the car says how much energy it needs and by when, and the charger sets the power in every loop answer. Your CSMS updates a Dynamic profile with UpdateDynamicSchedule, or the charger asks with PullDynamicScheduleUpdate.

Metering

Energy in and out have their own registers: Energy.Active.Import.Register and Energy.Active.Export.Register, and Power.Active.Import and Power.Active.Export for the power. The values are always positive. Check that your CSMS stores both and doesn’t net them into one number, or bill the export as if it were charging. The MeterValues guide covers measurands in general.

Set it up in Rey

You need four things, all in Rey:

  1. The charger takes power back. Under Configuration → Charger behaviour, tick Take power back from a car and set the most it takes back (11 kW unless you change it).
  2. The car gives power back. On EV & contracts, tick The car can give power back. The Older EV model can’t.
  3. ISO 15118-20 over TLS 1.3. The charger needs a P-521 or Ed448 certificate. With the Demo CSMS, pick OCPP 2.1 and choose Act as CSMS → Set up Plug & Charge. You can still start the charge with a card.
  4. Permission, on OCPP 2.1. Your CSMS’s Authorize answer has to allow DC_BPT or AC_BPT. The Demo CSMS does.

Rey's car settings on EV & contracts: ISO 15118-20, ISO 15118-2 and DIN 70121 ticked, TLS chosen, The car can give power back ticked (up to 22 kW DC or 11 kW AC), never below 30%, leaves in 8 hours, and the car controlling the power (scheduled)

The car’s settings shape the session:

  • Never below: the car stops giving power at this battery level. If it starts below it, it’s charged up to it first.
  • Leaves in: the departure time the car tells the charger, which reaches your CSMS in NotifyEVChargingNeeds.
  • Who controls the power: the car (scheduled) or the charger (dynamic).

Then plug in and start the charge. The car card’s Talks row says bidirectional, and the car gets Charge, Hold and Give back buttons.

Walkthrough: the Demo CSMS

With the Demo CSMS on OCPP 2.1, choose Act as CSMS → Bidirectional power (V2X). From there the demo can:

  • send a setpoint of 8 kW back, 20 kW charging, or 0 kW;
  • update the setpoint;
  • set the operation mode to Idle;
  • clear the profile;
  • give and withdraw the permission to give power back.

While the CSMS sets the power, the car’s buttons are greyed out and the car card says so. The Smart charging page draws the setpoint as a dashed line, below zero when the power comes from the car. A card that starts with NOV2G is authorized without the permission, so you can see a charging-only session too.

Rey's Smart charging page on OCPP 2.1 with a Dynamic TxProfile in operation mode CentralSetpoint: a setpoint of 8 kW back drawn as a dashed line below zero, and the conversation with NotifyEVChargingSchedule, TransactionEvent Updated and the DC charge loop giving 8 kW back

Walkthrough: your own CSMS

Connect Rey to your CSMS on OCPP 2.1, with My CSMS, a public wss:// address and a test charger ID. Connecting a virtual charge point to your CSMS covers the connection, and testing ISO 15118-20 Plug & Charge covers getting the -20 certificate onto the charger. Then check, in order:

CheckWhat to look for in Rey
Your Authorize answer allows giving power backThe car card says bidirectional. With no permission, the session is charging only.
You answer NotifyEVChargingNeedsYour status in the reply. After Accepted, your TxProfile has to arrive within 30 seconds.
Your setpoint is followedThe charger’s power and the Smart charging chart. Below zero, the charger says DISCHARGING.
A later permission worksStart with no permission, then send NotifyAllowedEnergyTransfer during the charge.
An ordinary profile stops giving power backSend a profile with no operation mode: the car goes back to charging only.
Dynamic updates workWith the car on dynamic control, send UpdateDynamicSchedule and watch the power change.
Both meters reach youThe import and export registers in the meter values your CSMS receives.

Or let the Test suite run four of these checks. On OCPP 2.1, Rey’s Test suite has four bidirectional tests: the car’s charging needs, a setpoint, a new setpoint for a Dynamic profile with UpdateDynamicSchedule, and NotifyAllowedEnergyTransfer during a charge. The first three need the charger’s -20 V2G root and SECC certificate, and Rey adds those tests to the run. If your CSMS doesn’t allow DC_BPT for the test card, they show as Not supported rather than Fail. CSMS test cases lists what each one expects.

Want to see what your CSMS does when a charger ignores a setpoint? Switch Drive to Step-by-step: Rey holds each message before it’s sent, so you can edit what the charger reports.

Limits to know

  • Power and current. The power never goes above the charger’s maximum current (500 A unless you change it; on DC, the current times the battery’s voltage).
  • Not in Rey: the External and Local operation modes, the mobility needs mode where the charger sets the departure time, priority charging, DER control, discharging while offline, reactive power, prices, and CHAdeMO’s own bidirectional charging.
  • The physical layer. The car and the charger run inside Rey and exchange real ISO 15118-20 messages, but the cable is in memory and the power is simulated.
  • DER control isn’t in Rey, so neither Rey nor its Test suite can test it.

The Rey handbook’s section on giving power back has every setting. For the bigger picture of V2G, V2H and V2L, see bidirectional charging explained (coming soon).