GreenFlux can establish a push connection to CPO Customers.
When a charging session starts, a Session object is created as a PUT call.
Any changes to a Session in the CPO system are sent by calling PATCH on the Sessions endpoint with the updated Session object. More information Session API
The Frequency is the MeterValueInterval, with a minimum of 60seconds between two Patch session.
1 ) With the start of a session, Greenflux calls the target Session endpoint with a PUT request with the newly created Session object.
The provided endpoint is appended with {country-id}/{party-id}/{session-id}.
e.g. /NL/GFX/NLGFX637561499213897595-ef07d
{
"id":"NLGFX637561499213897595-ef07d",
"start_datetime":"2021-05-09T09:38:39Z",
"end_datetime":null,
"kwh":0.0,
"auth_id":"NL*GFX*0dd6AE*6",
"auth_method":"WHITELIST",
"location":{
...
},
"meter_id":null,
"currency":"EUR",
"charging_periods":null,
"status":"ACTIVE",
"last_updated":"2021-05-09T09:38:41Z"
}
2 ) Updates to session
Any changes to a Session are sent to by calling PATCH on the destination Sessions endpoint with the updated Session object.
The request is sent to the provided endpoint appended with {country-id}/{party-id}/{session-id}.
e.g. /NL/GFX/NLGFX637561499213897595-ef07d
GreenFlux can send three different payloads for Patch of an active session and a final 'COMPLETED' payload at the end:
- Patch every 15mins
- Patch between a 15mins patch (i.e. when MeterValues are sent more frequently than 900seconds interval)
- Patch when Parking is detected
Optional fields
Only the fields/objects that have to be updated have to be present, other fields/objects that are not specified are considered unchanged.
GreenFlux may include unchanged fields in every PATCH (e.g. 'id' or 'start_datetime'), however a Customer should NOT base their business logic on the presence/absence of a field.
2.a) Patch session every 15mins
Every 15mins, a 'full' patch is sent as shown in the example below.
{
"id": "NLGFX637561499213897595-ef07d",
"start_datetime":"2021-05-09T09:38:39Z",
"kwh": 0.285,
"charging_periods": [
{
"start_date_time": "2021-05-09T09:38:39Z",
"dimensions": [
{
"type": "TIME",
"volume": 0.0833
},
{
"type": "ENERGY",
"volume": 0.285
}
]
}
],
"status": "ACTIVE",
"last_updated": "2021-05-09T09:43:39Z"
}
2.b) Patch session more frequently than 15mins
If MeterValues are received more frequently than a 900 seconds interval, then a 'compact' session payload is sent that excludes the 'charging_periods'.
However, the total kwh field is still present an increasing.
{
"start_datetime":"2021-05-09T09:38:39Z",
"kwh": 0.285,
"status": "ACTIVE"
"last_updated": "2021-05-09T09:43:39Z"
}
2.c) Parking
GreenFlux has enabled a 'parking detection' mechanism. In short, once kWh drops below a certain threshold between two meterValues, the EV is assumed to be 'PARKING'.
In this case the total kwh field is no longer included.
A Patch session is sent every 15mins, regardless if more frequent metervalues are received.
{
"id": "NLGFX637561499213897595-ef07d",
"start_datetime":"2021-05-09T09:38:39Z",
"charging_periods": [
{
"start_date_time": "2021-05-09T13:13:39Z",
"dimensions": [
{
"type": "PARKING_TIME",
"volume": 16.1602
}
]
}
],
"last_updated": "2021-05-09T13:13:39Z"
}
3 ) Completed session
Once the session is complete, a final session update with is sent with the status COMPLETED.
Note: There is no last charging period update at the same time with a Completed Patch update. The latest Time, Energy etc. need to be retrieved from the CDR.
{
"id": "NLGFX637561499213897595-ef07d",
"last_updated": "2021-05-10T05:27:27Z",
"status": "COMPLETED",
"start_datetime": "2021-05-09T09:38:39Z",
"end_datetime": "2021-05-10T05:27:25Z",
"kwh": 11.712
}