Sessions 2.0.1

A session is a core asset that encapsulates the attempts of the user (driver or admin) to affect a charging transaction. All metrics in a session are based on data reported by the chargestation sensors and meters.

Session Object

Session Creation:
When a new session is created (via a POST API request or via the dashboard), eDRV sends a remote start request to the chargestation (status = created)

Charging Start:
If the chargestation starts charging the status changes to (status = Started).

Charging Stop:
When the chargestation sends a successful stop charging message, (status = Ended)

Session Cancelled:
If the chargestation does not report that charging has start within 120 seconds of a session start attempt the session is cancelled (status = cancelled). E.g. when the driver did not insert his charging cable in time. In this scenario please create a new session to attempt a new charging session.

{
  "ok": true,
  "message": "Result",
  "result": {
    "_id": "681cba6d7fc34e09a9eb594f",
    "configurations": {
      "include_raw_energy_report": true,
      "include_id_tag": true,
      "include_artificial_status_notification_for_201": true
    },
    "user": "638631b192cd9c5ffa4ed8a7",
    "chargestation": "681cb6f07fc34e09a9eb56d3",
    "connector": "681cb7a47fc34e09a9eb5782",
    "status": "Started",
    "rate": "654cbe0bd9c4060b3b52bcd1",
    "metrics": {
      "chargingStart": "2025-05-08T14:06:38.295Z",
      "meterStart": 1966,
      "timezone": "Europe/Amsterdam",
      "chargingState": "Charging",
      "energyPeriod": 65.093,
      "energyConsumed": 448
    },
    "energy_report": {
      "current": {
        "value": 113.64,
        "unit": "A"
      },
      "power": {
        "value": 25,
        "unit": "kW"
      },
      "energy_meter": {
        "value": 2414,
        "unit": "Wh"
      },
      "state_of_charge": {
        "unit": null,
        "value": 0.52
      },
      "timestamp": "2025-05-08T14:07:43.358Z"
    },
    "raw_energy_report": {
      "timestamp": "2025-05-08T14:07:43.358Z",
      "current": [
        {
          "value": 113.64,
          "unit": "A",
          "phase": "L1-N",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ],
      "voltage": [
        {
          "value": 220,
          "unit": "V",
          "phase": "L1-N",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ],
      "power": [
        {
          "value": 25,
          "unit": "kW",
          "phase": "L1-N",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ],
      "energy_meter": [
        {
          "value": 2414,
          "unit": "Wh",
          "phase": "L1-N",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ],
      "energy_active_import_interval": [
        {
          "value": 448,
          "unit": "Wh",
          "phase": "L1-N",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ],
      "soc": [
        {
          "value": 0.52,
          "unit": "Percent",
          "timestamp": "2025-05-08T14:07:43.358Z"
        }
      ]
    },
    "raw_transaction_event": {
      "eventType": "Updated",
      "timestamp": "2025-05-08T14:07:43.358Z",
      "triggerReason": "MeterValuePeriodic",
      "seqNo": 17,
      "transactionInfo": {
        "transactionId": "f589203a-0b80-4550-93aa-7ac9e751528e",
        "chargingState": "Charging"
      },
      "evse": {
        "id": 1,
        "connectorId": 1
      },
      "meterValue": [
        {
          "timestamp": "2025-05-08T14:07:43.358Z",
          "sampledValue": [
            {
              "value": 448,
              "context": "Sample.Periodic",
              "measurand": "Energy.Active.Import.Interval",
              "location": "Outlet",
              "phase": "L1-N",
              "unitOfMeasure": {
                "unit": "Wh"
              }
            },
            {
              "phase": "L1-N",
              "unitOfMeasure": {
                "unit": "V"
              },
              "context": "Sample.Periodic",
              "measurand": "Voltage",
              "location": "Outlet",
              "value": 220
            },
            {
              "phase": "L1-N",
              "unitOfMeasure": {
                "unit": "A"
              },
              "context": "Sample.Periodic",
              "measurand": "Current.Import",
              "location": "Outlet",
              "value": 113.64
            },
            {
              "phase": "L1-N",
              "unitOfMeasure": {
                "unit": "kW"
              },
              "context": "Sample.Periodic",
              "measurand": "Power.Active.Import",
              "location": "Outlet",
              "value": 25
            },
            {
              "phase": "L1-N",
              "unitOfMeasure": {
                "unit": "Wh"
              },
              "context": "Sample.Periodic",
              "measurand": "Energy.Active.Import.Register",
              "location": "Outlet",
              "value": 2414
            },
            {
              "unitOfMeasure": {
                "unit": "Percent"
              },
              "context": "Sample.Periodic",
              "measurand": "SoC",
              "location": "EV",
              "value": 0.52
            }
          ]
        }
      ]
    },
    "charging_activity": [
      {
        "startTime": "2025-05-08T14:06:38.295Z",
        "endTime": "2025-05-08T14:07:43.388Z",
        "status": "Charging"
      }
    ],
    "cost": {
      "amount": 0,
      "currency": "usd",
      "breakdown": []
    },
    "id_tag": "0js1s7v6g0",
    "createdAt": "2025-05-08T14:06:38.417Z",
    "updatedAt": "2025-05-08T14:07:43.389Z",
    "edrv_meta_data": {
      "user": {
        "name": "undefined undefined"
      },
      "paid": false,
      "ocppId": "f589203a-0b80-4550-93aa-7ac9e751528e"
    }
  }
}

Attributes

_id string

The Id of this transaction

user string

The Id of the user

chargestation string

The Id of the chargestation where this charging transaction took place

connector string

The Id of the connector where this charging transaction took place

status string

The live current transaction status
Expected values are [created, Started,Ended, cancelled]

rate string

The rate Id applied for this charging session

target object Targets for this session. See Charging with Session Targets

time: number Max session time in Minutes
cost: number Max session cost in the currency of the rate applied to this connector
energy: number Max session energy in kWh
energy_start_time: date-time string UTC time for session to start delivering energy to a connected EV
energy_stop_time: date-time string UTC time for session to stop delivering energy to a connected EV

cost object The running estimate or final cost for this session

amount: number
currency: string Three digit currency code based on the Rate for this session
cost.breakdown: array with breakdowns of the cost amount

  • type: string Rate type applied. One of [FLAT, ENERGY,TIME]
  • period : object period during which cost applied
    period.startTime : datetime
    period.endTime : datetime
  • rateName: string Rate name
  • quantity: number Consumption e.g. 22.5kWh or 6.5h
  • unit: string Unit of quantity. One of [Wh, kWh,h]
  • unitPrice: number Price per unit e.g. $0.30 per kWh
  • beforeTax: number cost before tax
  • tax: number Tax as a %age
  • totalTax: number Tax amount
  • totalCost: number Total with tax

metrics object As reported directly by the Chargestation. Final when session.status = ended

energyConsumed: number As reported by the Chargestation meter in Wh
energyPeriod: number Energy consumption time period in Seconds
chargingStart: datetime Energy consumption start timestamp
chargingStop: datetime Charging session end timestamp
meterStart: number Charging session start register
meterStop: number Charging session end register
timezone: string Charging Station timezone
chargingStopReason: string Reason for session stop. (New in 2.0.1)
Reports the OCPP 201 TriggerReason at the end of a charging session i.e. (TransactionEvent.eventType = Ended). For a full list of reasons please see: (see 3.82. TriggerReasonEnumType)
chargingState: string Current charging state. (New in 2.0.1)
The state of the charging process when reported in a transactionEvent message. Possible values are Charging, EVConnected, SuspendedEV, SuspendedEVSE, Idle.

energy_report object Instantaneous session energy information

timestamp: datetime report timestamp in UTC

current: object Instantaneous current flow to the EV

  • current.value: number
  • current.unit: string Expected values are [A] for Amperes

power: object Instantaneous active power imported by the EV.

  • power.value: number
  • power.unit: string Expected values are [W,kW]

energy_meter: object Chargestation's Meter register. Reports total lifetime energy imported from the grid supply by this chargestation.

  • energy_meter.value: number
  • energy_meter.unit: string Expected values are [Wh,kWh]

state_of_charge: object report the vehicle state of charge if and only if reported by the chargestation

  • state_of_charge.value: number Vehicle State of Charge as a percentage
  • state_of_charge.unit: string

raw_energy_report Embedded object This object is not strictly defined.

The raw meterValue message sent by the Chargestation. See OCPP-2.0.1_part2_specification (1.60.1. TransactionEventRequest)


raw_transaction_event Embedded object This object is not strictly defined. (New in 2.0.1)

The raw TransactionEvent message sent by the Chargestation. See OCPP-2.0.1_part2_specification (1.60.1. TransactionEventRequest)

charging_activity array of object chronological state changes of the connector during the session

  • startTime: datetime
  • endTime: datetime
  • status: string Expected values Available, Charging, ParkingTime, Reserved, Unavailable, Faulted',ParkingTime

id_tag string

Id tag used to authorize the session. If the session was started with include_id_tag : true, the session object will also contain id_tag.

meta_data object

Any session specific data the developer would like to include

configurations object Configurations for the session

include_raw_energy_report: boolean option to include raw_energy_report in the session object

include_id_tag: boolean option to include id tag info in the session object

createdAt datetime

Creation time of this Session record

updatedAt datetime

Last update time of this Session record


What’s Next