Skip to content

About

Open fault finder for air/water and brine heat pumps: COP, SPF and 7 explainable faults from ordinary monitoring data, ranked by CHF/year

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

heatpump-cop-doctor

Open fault finder for air/water and brine heat pumps in homes: it works from the monitoring data a typical install already has and ranks the faults it finds by estimated CHF per year lost.

Result figure

All results in the figure are from simulated houses with injected faults. Outdoor temperatures are real (Open-Meteo, 2024).

What it does

Input: one hourly table per house with electricity in, heat out, flow and return temperature, outdoor temperature, compressor run minutes and starts. Optional columns: defrost minutes, backup-heater energy, hot-water mode minutes and tank temperature, flow rate.

  • Computes hourly and daily COP, the seasonal performance factor (SPF), a COP at A7/W35 from a baseline model (normalised for outdoor and flow temperature), and the SPF the house would have had on a reference heating curve.
  • Detects seven faults with explainable rules plus a simple model baseline (COP as a function of flow and outdoor temperature, fitted on the house's own first 90 days):
Fault Rule
Short-cycling share of running hours with under 8 min per start is 25% or more
Excessive defrost defrost minutes above 10% of run time between -6 and 4 deg C (reference 5%)
Heating curve too high daily mean flow temperature more than 3 K above the reference curve
Backup heater 3 or more hours per day above -3 deg C with backup-heater energy outside hot-water cycles
Low flow / high delta-T daily median flow-return spread above 1.3x the house's own baseline
COP degraded COP under 92% of the baseline model for a week; reported only if no specific cause above is found
Frequent legionella cycles more than 3 tank cycles at 58 deg C or above in 14 days
  • Every rule is debounced (4 flagged days in a 10-day window). Each finding carries its evidence, the date it started and an estimated loss, and findings are ranked per house by CHF/year.
  • CHF uses an illustrative tariff of 0.27 CHF/kWh of electricity. It is a round number, not a quote; change it with Config(tariff_chf_kwh=...).

Results

Measured by python -m heatpump_doctor demo, seed 7. Simulated: 60 single-family houses (3 locations, air and brine sources), 42 with one injected fault of known type, onset and size, 18 healthy. Time series cover 2024-01-01 to 2024-12-31, hourly.

Metric Result
Detection recall (faulted houses flagged) 42 of 42 (100%)
Detection precision (flagged houses that are faulted) 42 of 43 (97.7%)
Healthy houses falsely flagged 1 of 18
Median detection delay 3 days
Diagnosis macro-F1 (top-ranked finding vs injected type, 8 classes incl. healthy) 0.987
CHF estimate error vs simulated truth (median) 23% (24 CHF per house over the post-onset period)
Sum of estimates vs sum of truth 6,196 vs 8,007 CHF (estimates run about 23% low)

Per fault type (6 houses each): median delay is 4 days for short-cycling, 23 for excessive defrost, 11 for a too-high curve, 3 for backup heater, 3 for low flow, 14 for COP degradation and 2 for legionella cycles. Defrost is slow because it only shows in the cold, damp band. Truth is the extra electricity versus a paired fault-free run on identical random draws.

Other seeds, 8 fleets of 60 houses (scripts/robustness.py, docs/robustness.json): recall 100% in every fleet; precision 93.3% to 100%; 12 of 144 healthy houses falsely flagged in total; macro-F1 0.946 to 1.000; median delay 3 to 5 days; median CHF error 20.7% to 25.0%.

These numbers come from a simulator written by the same author as the detectors. They show that the rules work on the faults as modelled, not that they work on real houses.

Quick start

pip install -e ".[dev]"
python -m heatpump_doctor demo            # ~5 s, reproduces the table above
python -m heatpump_doctor demo --quick    # one location, used in CI
python -m heatpump_doctor simulate --fault low_flow --onset-day 150 --out house.csv
python -m heatpump_doctor analyze house.csv

Your own data: analyze your.csv, with columns ts, t_out, t_flow, t_return, e_kwh, q_kwh, runtime_min, starts (required) and flow_lps, e_backup_kwh, defrost_min, dhw_min, dhw_tmax_c (optional; rules that need a missing column are skipped and reported). Needs about 90 clean days at the start for the baseline, and a full year for a meaningful CHF/year.

python scripts/make_figures.py rebuilds docs/figure.png and docs/post-figure.png.

How it works

flowchart LR
  W[Hourly outdoor temp] --> S[Simulator: house + heat pump + injected fault]
  S --> D[Hourly monitoring table]
  D --> B[Baseline: COP = f flow temp, outdoor temp]
  D --> R[Daily rule features]
  B --> R
  R --> E[Debounce: 4 of 10 days]
  E --> L[Loss estimate in kWh and CHF]
  L --> K[Per-house ranking]
Loading
  • Simulator (sim.py): hourly heat demand from a one-zone house (UA, setpoint, gains, 6 h thermal lag); weather-compensated flow temperature; heat-pump COP as a fraction of the Carnot COP with part-load, cycling and defrost penalties; capacity falling with outdoor temperature, with a backup heater covering the shortfall; two hot-water charges per day and a weekly legionella cycle. Every fault run is paired with a fault-free run on the same random draws so the true extra electricity is known.
  • Baseline (cop.py): least-squares COP model on a Carnot-style lift ratio and outdoor temperature, fitted on the first 90 days. It is only evaluated inside the operating envelope it was fitted on, so summer extrapolation does not raise alarms.
  • Rules and losses (detect.py): each rule yields a daily flag. The loss is the electricity above what the baseline expects for the heat delivered (or, for backup heater, defrost and legionella, the energy of the offending events), from the first flagged day. Annual figures scale by the share of yearly heat delivered after that day (by time for legionella).
  • Scoring (evaluate.py): house-level labels, so the top-ranked finding is the diagnosis.

Data sources

  • Outdoor temperature: Open-Meteo.com historical weather API, hourly 2 m temperature, 2024-01-01 to 2024-12-31 (UTC), Zurich (47.37, 8.54), Bern (46.95, 7.45) and Davos (46.80, 9.84). Licence CC BY 4.0, committed as three small CSV fixtures in src/heatpump_doctor/data/. Refresh with python scripts/fetch_weather.py.
  • Everything else is simulated. No real heat-pump monitoring data is included. A public heat-pump monitoring community publishes per-system data, but I could not confirm a permissive licence for that data, so none is committed or used in any result here.

What is not verified yet

  • Not tested on any real heat-pump data. Real meters have gaps, drift, clock errors and coarser sensors than the simulator's small Gaussian noise.
  • The simulator and detectors share assumptions (a defrost power of 2 kW, a 12 min minimum run, 5 K nominal spread, Carnot-fraction COP), so recall and CHF error are optimistic. Faults are injected one per house, never in combination.
  • Faults start between day 100 and day 310 and the first 90 days are assumed fault-free; a fault present from commissioning is invisible to the "own earlier signature" model.
  • CHF estimates run about 23% low in this simulation, and annualising from a partial season is crude.
  • The tariff is illustrative; no time-of-use or demand charge is modelled.
  • The healthy false-alarm rate (12 of 144 healthy houses over 8 seeds) consists entirely of COP-degradation alarms; the baseline's extrapolation limits are not fully characterised.
  • Time axis is UTC and hot-water schedules sit on the UTC clock; no night setback, no occupancy variation, no hydraulic buffer dynamics.
  • Thresholds were chosen once by the author and then checked on 8 seeds; they are not tuned for any real installation.

Licence

MIT, Copyright (c) 2026 VB-Builds. See LICENSE.

About

Open fault finder for air/water and brine heat pumps: COP, SPF and 7 explainable faults from ordinary monitoring data, ranked by CHF/year

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages