dbt models for OCPP logs here
kwwhat is an open-source dbt project that models reliability and utilization metrics from EV charger logs based on the OCPP 1.6 and 2.0.1 protocols. Starting from raw OCPP logs, the project builds a transparent path toward meaningful metrics like uptime, session success, and visit-level outcomes.
This project is powered by public OCPP log data and is designed for CSMS providers, utilities, researchers, and data practitioners aiming to build their own charger analytics stack.
kwwhat includes:
- Source modeling for raw OCPP logs (StatusNotification, Heartbeat, Start/StopTransaction)
- Session and visit grouping logic
- Core metrics like:
- Outages: from, to, type
- Port _uptime (% time chargers heartbeating and ports not faulted - a solid base for calculating uptime by adding maintenance and exclusion rules)
- Attempt success
- Visit success
- First attempt success rate
- Troubled success rate
- Public OCPP logs for realistic examples
- Modular dbt structure to plug into your existing stack
- Interval data for other reporting use cases that require energy delivery by 15-min time slices
Check Tableau dashboard here
- Charger means a device with one or more charging ports and connectors for charging EVs. Also referred to as Electric Vehicle Supply Equipment (EVSE).
- Charging port means the system within a charger that charges one EV. A charging port may have multiple connectors, but it can provide power to charge only one EV through one connector at a time.
- Connector means the device that attaches an EV to a charging port in order to transfer electricity.
Source: 23 CFR §680.104 — National Electric Vehicle Infrastructure Standards and Requirements
Charge attempt is successful when:
- there is a transaction (energy transfer)
- next connector status is not ‘Faulted'
- transaction stop reason is 'Local’ or ‘Remote’ or ‘EVDisconnected'
- energy transferred is above 0.1 kWh
partially borrowed from https://github.com/chargex-consortium/OCPP-2.0.1-Interim-KPI-Calculator
Visits is successful when the last attempt of the visit is successful.
a modification of visit success when at least one charge attempt is successful here Customer-Focused Key Performance Indicators (KPIs) for Electric Vehicle Charging
git clone https://github.com/YOUR_USERNAME/kwwhat.git
cd kwwhatThen update your profiles.yml to point to your raw data location (e.g., DuckDB, BigQuery, Snowflake, Redshift, etc.).
| Metric | Description |
|---|---|
_uptime_pct |
% of time a charger had a regular heartbeat and port was not in a Faulted state |
visit_success_rate |
% of visits that result in meaningful energy transfer. Visit is a rollup of sessions generated by the same driver on the co-located chargers close in time |
first_attempt_success_rate |
Visits where the first charging attempt succeeded |
troubled_success_rate |
Visits that initially failed but succeeded sfter some troubleshooting |
-
OCPP 1.6 logs were kindly donated by Epic Charging
-
OCPP 2.0.1 logs were borrowed from OCPP-2.0.1-Interim-KPI-Calculator
Seed data was generated with OCPP synthetic log generator
Use dbt seed command to add seed data to your warehouse.
Designed based on industry frameworks and academic research to align metrics with real-world expectations:
-
The Public EV Charging Infrastructure Playbook by U.S. Joint Office offers guidance for performance evaluation in EV infrastructure EV Charging KPI Playbook
-
The Sage‑published journal article Novel Methodology to Measure the Reliability of Public DC Fast Charging Stations proposes a data-driven framework for charger reliability, which informed the visits logic in kwwhat. Novel Methodology to Measure the Reliability of Public DC Fast Charging Stations
-
Uptime calculations modeled in part after NEVI guidelines
This project was created independently and outside of any prior employment. It does not include any proprietary information, logic, or data.
The kwwhat project is licensed under the MIT License. External datasets and tools used in this repo follow their respective licenses as noted above.
Open to contributions from the EV data community. If you’re building in this space and want to improve reliability tracking, user experience analytics, or charger diagnostics — join in!
Questions? Ideas? Drop an issue or find us on LinkedIn kwwhat