How to send meter values with meterValues.req
Intro
Meter readings are one of the most important elements of energy billing, monitoring, and management. The meter reading value is of interest to the driver, fleet operator, grid operator, and energy supplier.
Meter readings for electric vehicles are technically very similar to building meters. However, modern charging systems offer many more capabilities.
Types of Meter Values
OCPP differentiates between intended purpose: 1) Charging Session Meter Values and 2) Clock-Aligned Meter Values.
- Charging Session Meter Values
Also called “sampled meter data”, charging session meter values are measured and sent in specific intervals (e.g., 1 minute) from the charge point to the CMS. These meter values are only sent during a charging session and offer “real-time” measurement. - Clock-Aligned Meter Values
Clock-aligned meter values are measured, sent regularly, and aligned with a specific clock time. For example, the charge point may send meter values every 15 minutes, even without an active charging session. This data might be relevant for the grid operator. These values are typically not considered to be real-time values.
Both types of meter reading may be sent with the MeterValues.req message and the StopTransaction.req message (inside transaction data) in OCPP 1.6 and OCPP 2.0.
In OCPP, the metervalue.req contains three fields: connectorId, transactionId, and meterValue.
The meterValue field includes the timestamp and the sampledValue.
The sampledValue field is a larger object that specifies meter values. Importantly, the sampledValue field is an array and can contain multiple meter values.
Let’s take a look at the sampledValue:
- Value: This is the actual meter value that was measured. In the case of 20 kW, this file will show “20”. Be careful however, as OCPP requires a String format.
- Context: Here, OCPP differentiates whether the meter value is clock aligned “Sample.Clock”, session-related meter value “sample.Periodic, or any other type.
- Format: As OCPP sends the value as String, this format field specifies the format of that particular value. “Raw” refers to either an integer or decimal value and “SignedData” refers to an encoded data block. “Raw” is more typical.
- Measurand: Refers to the type of measurement. In other words, it tells us what type of value we are receiving. Typically, charge points send energy (“Energy.Active.Import.Interva”), power (“Power.Active.Import”), and current (“Current.Import”). OCPP specifies over 22 measurands. This is why sampledValue can contain several measurands per message.
- Phase: Refers to the electrical phase where the charge point measured the data point. Either the measurand was taken at a specific phase (e.g. “L1”), between phases (e.g. “L1-L2”), or independent for any phase. Especially for energy related measurands (voltage, current, etc.) this becomes important.
- Location: Not every meter value is measured at the same location. Therefore, the OCPP message specifies the exact location, such as “Cable”, “Inlet”, or “Body”.
- Unit: As the Value field doesn’t give us any information about the unit, OCPP has this separate unit field. Each measurand can have different values. Energy can have “kWh” or “Wh”. OCPP specified over 16 unit types including Percentage, Ampere, Celsius, Power, and more.
How to send meter values in OCPP
In order to receive meter values from the charging stations we need to start by setting the charging station configurations.
In the example below, we will be making settings for a Tritium DC charger.
Configure your charger:
Go into your Charging Management System (CMS), which gives you access to the charging station logs and remote setting possibilities. Typically, a modern CMS system gives you full control over major settings like meter values.Most hardware manufacturers differentiate correctly between the SampledData and the ClockAligned data. This means you have settings for both.
We are changing 3 things:
- MeterValuesSampledData (the measurands)
- MeterValueSampleInterval (the intervals of the meter during a session in seconds)
- ClockAlignedDataInterval (the intervals for the ClockAligned metering in seconds)
This means the charger will send meter values every 60 seconds during the charging session and every 15 minutes in general (00:15, 00:30, etc.)
We want to receive energy power, current, SoC, Temperature, Voltage, Frequency
Use meterValue.req:
- After making the changes, some chargers require a soft restart of the charging station. If so, go ahead and restart the charger remotely.
- Next, we start a charging session and observe the log data on the CMS (if possible)
[
2,
"16f0c9fed9ce254b",
"MeterValues",
{
"connectorId": 1,
"transactionId": 1344615480,
"meterValue": [
{
"timestamp": "2022-05-20T10:39:19.657Z",
"sampledValue": [
{
"value": "12903.0",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Energy.Active.Import.Register",
"location": "Outlet",
"unit": "Wh"
},
{
"value": "50000.0",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Power.Active.Import",
"location": "Outlet",
"unit": "W"
},
{
"value": "50.0",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Current.Import",
"location": "Outlet",
"unit": "A"
},
{
"value": "63.0",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "SoC",
"location": "EV",
"unit": "Percent"
},
{
"value": "298.8",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Temperature",
"location": "Body",
"unit": "K"
},
{
"value": "270.4",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Voltage",
"location": "Inlet",
"unit": "V"
},
{
"value": "60.0",
"context": "Sample.Periodic",
"format": "Raw",
"measurand": "Frequency",
"location": "Inlet"
}
]
}
]
}
]
- We receive meter values every 60 seconds that contain all the meter values we require.
- As an example, we received 50,000 Watts (50 kW) that were measured at the outlet of the charger.
- We also see the transactionID, the connectorId, and all other fields that we described above. As not all fields are mandatory, so you might not find all fields.
The Importance of Meter Values
At Ampcontrol, we’re using meter values extensively for our energy management algorithms and smart charging functionalities.
The smart charging system applies an intelligent decision-making process that automatically adjusts the power output from the charging station. The smart system can, at any appropriate time, increase power, reduce power, or delay the charging process.
Besides sending charging profiles to the charging hardware, Ampcontrol’s optimization has to “read” the metering of each charging station. Only by properly monitoring the charging, the optimization adjusts very quickly. For example, a vehicle might charge slowly and our optimization algorithm might shift the remaining power to the other vehicles.
Especially for fleet charging, Ampcontrol uses information such as the State of Charge (SoC) of vehicles. There, we often combine this with non-OCPP data such as departure times, and the required energy for the next trip.
Summary
The OCPP client (EV charger) sends meter values to a charging management system (CMS) and smart charging software using OCPP. The meterValues.req message in OCPP can contain up to 22 measurands such as power, energy, voltage, or state of charge of the EV battery.
OCPP differentiates between two types of meter reading – Charging Session Meter Values and Clock-Aligned Meter Values. For both, you can typically set intervals (e.g., 60 seconds) on your charge point hardware.
Meter readings are essential for billing and energy management for electric vehicle charging. At Ampcontrol, we visualize and use the meter values that are sent through the OCPP messages. For example, the smart charging systems apply automatic power management using meter values.
Outline
Intro
Types of Meter Values
How to Send Meter Values in OCPP
The Importance of Meter Values
Summary