Command and Control

The REST API funcionalities and endpoints are designed to empower your end users with features and functions such the smart charging. Since the API is built with standard web methods(HTTP) is quicker that OCPP, but there needs to be a basic to moderate knowledge on how it works from your side.

One of the most basic use cases in electric vehicle charging (EVC) is the simple command and control of devices. This means the control of when a device starts, when it stops, who is allowed to make a device start (identity and access) and various other things such as changing settings.

Within this section we will give you a short introduction to the use case of starting a charge session and then stopping it.

Using the Easee REST API to Start and Stop a Charge Session

With the REST API we can imagine a sequence like this for starting and stopping a charge session:

380

Flow diagram of START and STOP session

To create this flow in reality we use the following endpoints:

The folloing link doesnt work, get {"error":"You do not have access to this project."}
Can someone please fixa this?

🚧

🚨 Don’t forget to authenticate before you start trying endpoints!
AUthentication

*START*
curl --request POST \
     --url https://api.easee.com/api/chargers/id/commands/start_charging

*STATUS*
curl --request GET \
     --url https://api.easee.com/api/chargers/id/sessions/ongoing \
     --header 'Accept: application/json'

*STOP*
curl --request POST \
     --url https://api.easee.com/api/chargers/id/commands/stop_charging

*REBOOT*
curl --request POST \
     --url https://api.easee.com/api/chargers/id/commands/reboot \
     

From the status request we would get something like this:

{
  "chargerId": "string",
  "sessionEnergy": 0,
  "sessionStart": "2022-04-22T10:01:06.968Z",
  "sessionEnd": "2022-04-22T10:01:06.968Z",
  "sessionId": 0,
  "chargeDurationInSeconds": 0,
  "firstEnergyTransferPeriodStart": "2022-04-22T10:01:06.968Z",
  "lastEnergyTransferPeriodEnd": "2022-04-22T10:01:06.968Z",
  "pricePrKwhIncludingVat": 0,
  "pricePerKwhExcludingVat": 0,
  "vatPercentage": 0,
  "currencyId": "string",
  "costIncludingVat": 0,
  "costExcludingVat": 0
}

Within this JSON we gain an understanding about the charging session we have just asked to start:

chargerIdthis it the serial number of the charger you are working with
sessionEnergythis is the amount of energy the current session has given to the EV in kW. At first this will of course be zero, but you can query it over time to see how things are progressing
firstEnergyTransferPeriodStartthis is the time when energy first started flowing to the EV. This is important as starting a session doesn’t always mean energy starts flowing because things like smart charging (charging according to a schedule) might be stopping the energy from flowing. However, starting a session means you have actually opened an opportunity to charge

The rest of the details are quite self explanatory, but please do reach out if you would like to know more.

Charger Settings

Charger settings can be changed using the Change Charger Settings endpoint. Each body parameter is explained below.

RFID authorisation

authorizationRequired Set to enable authorization. Charging will not start until the charge point is authorized.

localPreAuthorizeEnabled This setting will allow the charger to pre-authorize a charge session using the RFID list stored in the charger. If the backend system is unable to verify within 20 seconds, offline rules will apply.

localAuthorizeOfflineEnabled This setting will allow the charger to use the local RFID list when the charger is offline.

allowOfflineTxForUnknownId Set to allow charging for any tag when offline (user must still present a tag).

lockCablePermanently This setting will lock and unlock the cable permanently in charger settings.
If state = true, cable always locked in charger. state = false, cable is unlocked when car is disconnected

Recommend settings if you want to use RFID authorisation:

authorizationRequired = True
localPreAuthorizeEnabled = True
localAuthorizeOfflineEnabled = True
allowOfflineTxForUnknownId = True
lockCablePermanently = False 

📘

Easee recommends setting AllowOfflineTxForUnknownId = True because this will provide the best user experience if there should be an issue with internet.