ChargeData is a fully local Home Assistant integration that learns EV charging behavior from Recorder data and predicts the remaining charge time, finish time, progress, and expected energy.
- Local-only learning: no cloud service, account, or telemetry.
- Native UI setup: configure source entities through a Config Flow.
- Historical bootstrap: reconstructs plausible sessions from cumulative 5-minute Recorder statistics.
- Robust session boundaries: Recorder gaps longer than 10 minutes are hard boundaries; short/slow/overlong outliers are rejected.
- Context-aware forecasts: matches by weekday/weekend, charging start time, and optional person/work context.
- Restart-safe: completed and active sessions are stored in Home Assistant's
.storagelayer. - Transparent model: confidence, method, matched-session count, ETA range, source entities, and end-phase detection are exposed as attributes.
- Open HACS → Integrations → ⋮ → Custom repositories.
- Add
https://github.com/thorethy1/ha-chargedataas category Integration. - Install ChargeData and restart Home Assistant.
- Open Settings → Devices & services → Add integration → ChargeData.
- A charging power sensor using a Home Assistant power unit (for example W or kW)
- A cumulative charging energy sensor using a Home Assistant energy unit (for example Wh, kWh, or MJ)
Optional inputs improve behavior:
- Charging status entity (
binary_sensor,input_boolean, orswitch) - Person and work-zone entities
- Usable battery capacity entity in kWh
- Per-session target-energy override entity in kWh
| Sensor | Purpose |
|---|---|
| Status | Idle, charging, or detected end phase |
| Remaining time | Learned ETA in minutes |
| Finish time | Timestamp calculated from the ETA |
| Progress | Current session energy / expected total |
| Expected energy | Learned total charge energy |
| Model quality | Sample-size and stability score |
| Learned sessions | Persisted model sample count |
| Current session energy | Energy since session start |
| Current charging power | Current source power in kW |
| Context | Workday, weekday, weekend, or unknown |
| Estimated start battery | Estimated start SOC from expected energy and usable capacity, assuming charging ends at 100% usable SOC |
The initial model uses cumulative Recorder statistics and keeps only sessions that are:
- at least 0.5 kWh,
- at least 15 minutes and no more than 8 hours,
- between 0.8 and 22 kW average power,
- composed of samples no more than 10 minutes apart.
For current sessions, a configured charging-status entity is authoritative. Without one, ChargeData confirms a stop only after the configured low-power delay. Predictions prefer at least three sessions with a similar start time (±4 hours) and context; otherwise they safely fall back to the broader history.
ChargeData does not make network requests. It reads local Home Assistant states and Recorder statistics and stores its compact learned sessions locally. It never stores raw GPS coordinates.
python -m venv .venv
.venv/bin/pip install 'pytest>=8.4' 'pytest-cov>=6.2' 'ruff>=0.12'
.venv/bin/pytest
.venv/bin/ruff check .MIT