Hi all, sharing a custom integration I’ve been building: HA External Recorder (ha_recorder_ext).
It’s meant as a complement to the built-in recorder, not a replacement — aimed at people who want to actually use their history data for feature engineering, ML training, or analytics, instead of just browsing it in the History panel.
Why not just use the native recorder?
It stores raw state-changed events. Great for the History UI, painful for analytics: you end up writing your own dedup/interval logic on every export.
What this does differently
Each stored record represents one value for one field (state or one attribute) over a validity interval — first_seen / last_seen — instead of one row per event. Example for a temperature sensor:
- T0: value 20.0 → INSERT (first_seen=T0, last_seen=T0)
- T1: value 20.0 → UPDATE (same value, last_seen becomes T1, no duplicate row)
- T2: value 21.0 → INSERT (new interval: first_seen=T2, last_seen=T2)
- T3: value 20.0 → INSERT (new interval again — not merged back into the T0 row)
Repeated identical values just extend the interval; a value change opens a new one. More compact, and closer to what you actually want for feature extraction.
Other bits
- SQLite (embedded, default), MySQL, or PostgreSQL backends behind a common storage abstraction
- UI config flow, no YAML required
- Include/exclude filters by domain, entity, or attribute
- A service to backfill history from your existing recorder (or an external HA database) into this format, idempotent and resumable
- Diagnostics support, async-first, buffered/batched writes so it doesn’t block the event loop
Status
Targeting Home Assistant’s Bronze quality scale as a baseline, actively maintained, ~150 tests. Not yet in the HACS default list (PR open: hacs/default#9357) — for now add it as a custom repository:
Feedback, issues, and PRs welcome — especially interested in what other analytics/ML workflows people would want to build on top of this.