Reporting

Charging Session Stats objects

A charging session stats object is defined as following:

label
A label describing this object, may be null (see further).
count
Number of sessions.
averageDuration
The average duration of a session (in seconds).
averageKiloWattHour
The average amount of energy charged per session (in kWh).

Service

GET /abs/frontend/report/chargingSessionStats

Fetch aggregate data from several sessions. Multiple filters can be combined. Note that time operations only look at the start of the session regardless of how long it lasts.

Role:

admin

Query Parameters:
 
  • limit? – Maximum number of results per page (default: 100).
  • page? – Page number.
  • timeFrom? – Limit to charging sessions started after this timestamp.
  • timeTo? – Limit to charging sessions ended before this timestamp.
  • socketId? – Only fetch sessions on this socket.
  • chargingStationId? – Only fetch sessions from this charging station.
  • groupBy? – Groups the results.

The return value depends on whether the groupBy parameter was specified or not.

Possible literal values for grouping stats:
  • socket
  • chargingStation
  • weekday
  • month
  • year

Example: an un-grouped query

GET /abs/frontend/report/chargingSessionStats?chargingStationId=7

{
  statusCode: "100",
  chargingSessionStats: {
    "label": null,
    "count": 70,
    "averageDuration": 1490.8099571428572,
    "averageKiloWattHour": 0.39341428571428566
  }
}

Example: a query grouped by an object

GET /abs/frontend/report/chargingSessionStats?chargingStationId=7&groupBy=socket

{
  statusCode: "100",
  chargingSessionStats: {
    13: {
        "label": "Socket 1",
        "count": 60,
        "averageDuration": 1727.9206333333334,
        "averageKiloWattHour": 0.3976833333333333
    },

    14: {
        "label": "Socket 2",
        "count": 10,
        "averageDuration": 68.14590000000001,
        "averageKiloWattHour": 0.3678
    }
  }
}

In this case, chargingSessionStats represents a mapping of a socketId to a chargingSessionStats object. The label is the name of the socket.

Example: a query grouped by a time part

When grouping by a time part, the key of the chargingSessionStats mapping is a value representing this part as defined by ISO 8601. The label is null.

GET /abs/frontend/report/chargingSessionStats?chargingStationId=7&groupBy=weekday

{
  statusCode: "100",
  chargingSessionStats: {
    1: {
        "label": null,
        "count": 2,
        "averageDuration": 3.5,
        "averageKiloWattHour": 0.0025
    },

    2: {
        "label": null,
        "count": 3,
        "averageDuration": 20.072,
        "averageKiloWattHour": 0.001
    },

    3: {
        "label": null,
        "count": 22,
        "averageDuration": 95.89277272727271,
        "averageKiloWattHour": 0.08572727272727272
    },

    4: {
        "label": null,
        "count": 18,
        "averageDuration": 5502.643055555555,
        "averageKiloWattHour": 0.7784444444444444
    },

    5: {
        "label": null,
        "count": 25,
        "averageDuration": 125.2906,
        "averageKiloWattHour": 0.46532
    }
  }
}

The key is the day of the week (1-7, starting with Monday).