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": "6464bfe3a1bc750b39ae3de0",
    "configurations": {
      "include_raw_energy_report": false,
      "include_id_tag": true,
    },
    "user": "615ec8c82cf705033a667b81",
    "chargestation": "644a58a868bf304318358001",
    "connector": "644a58a968bf304318358018",
    "status": "Started",
    "rate": "62569ca2f94d5506460d9f42",
    "metrics": {
      "chargingStart": "2023-05-17T11:52:03.762Z",
      "meterStart": 693,
      "timezone": "Asia/Baghdad",
      "energyPeriod": 240.188,
      "energyConsumed": 0
    },
    "energy_report": {
      "current": {
        "value": 0,
        "unit": "A"
      },
      "power": {
        "value": 0,
        "unit": "kW"
      },
      "energy_meter": {
        "value": 693,
        "unit": "Wh"
      },
      "state_of_charge": {
        "unit": "Percent",
        "value": "0.00"
      },
      "timestamp": "2023-05-17T11:56:03.891Z"
    },
    "charging_activity": [
      {
        "startTime": "2023-05-17T11:52:03.762Z",
        "endTime": "2023-05-17T11:56:03.950Z",
        "status": "Charging"
      }
    ],
    "cost": {
      "amount": 3.198,
      "currency": "usd",
      "breakdown": [
        {
          "type": "FLAT",
          "period": {
            "startTime": "2023-05-17T11:52:02Z",
            "endTime": null
          },
          "rateName": "All-$3-Grace-6m",
          "quantity": 1,
          "unit": "",
          "unitPrice": 3,
          "beforeTax": 3,
          "tax": 0,
          "totalTax": 0,
          "totalCost": 3
        },
        {
          "type": "TIME",
          "period": {
            "startTime": "2023-05-17T11:52:02Z",
            "endTime": "2023-05-17T11:56:01Z"
          },
          "rateName": "All-$3-Grace-6m",
          "quantity": 0.066,
          "unit": "hours",
          "unitPrice": 3,
          "beforeTax": 0.198,
          "tax": 0,
          "totalTax": 0,
          "totalCost": 0.198
        }
      ]
    },
    "id_tag": "VIN:342332234",
    "meta_data": null,
    "createdAt": "2023-05-17T11:52:03.831Z",
    "updatedAt": "2023-05-17T11:56:04.247Z"
  }
}

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

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

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

Raw Energy Report

If the session was started with include_raw_energy_report : true, the session object will also contain raw_energy_report. When reported by the charging station, this object contains current, voltage, and power per phase.

{
	"timestamp": "2023-03-02T13:56:00.000Z",
	"current": [{
			"value": "16.8",
			"unit": "A",
			"phase": "L1"
		},
		{
			"value": "15.85",
			"unit": "A",
			"phase": "L2"
		},
		{
			"value": "0.0",
			"unit": "A",
			"phase": "L3"
		}
	],
	"voltage": [{
			"value": "227.00",
			"unit": "V",
			"phase": "L1-N"
		},
		{
			"value": "226.40",
			"unit": "V",
			"phase": "L2-N"
		},
		{
			"value": "233.90",
			"unit": "V",
			"phase": "L3-N"
		}
	],
	"power": [{
			"value": "3627",
			"unit": "W",
			"phase": "L1"
		},
		{
			"value": "3566",
			"unit": "W",
			"phase": "L2"
		},
		{
			"value": "1",
			"unit": "W",
			"phase": "L3"
		}
	],
	"energy_meter": [{
		"value": "4174",
		"unit": "Wh"
	}]
}