mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Electric storage heaters (and CPSU) charge overnight and cannot run economically on a single rate, so their presence is physical evidence the dwelling is on an off-peak tariff. RdSAP 10 §12 (PDF p.62) applied Rules 1-4 only for a Dual meter; an "Unknown" (code 3) meter returned STANDARD without consulting the heating type, so a cat-7 storage main billed its overnight charge at the standard 13.19 p/kWh instead of the 7-hour low rate (5.50 p/kWh) — ~2.4x too high → large under-rate. Two coupled fixes: - `rdsap_tariff_for_cert`: for an Unknown meter, infer the off-peak tariff from a Rule-1 CPSU (→10-hour) or Rule-2 storage (→7-hour) main; keep STANDARD otherwise. Direct-acting/room heaters/heat pumps (Rule 3) are NOT off-peak evidence (run on demand, exist on single-rate meters) so they stay STANDARD — billing them 100% at the low rate over-credits. - `_fuel_cost` now resolves its tariff via the §12-aware `_rdsap_tariff` (not the raw `tariff_from_meter_type`), so the off-peak branch fires for these storage certs and the legacy scalar fields bill the low rate. Mirrors `_is_off_peak_meter`'s existing Unknown+electric heuristic (which already routes HW/secondary off-peak), closing the main-space-heating gap. Meter-3 electric cluster: mean |err| 11.18 → 6.52, within-1.0 3 → 5 (cert 7336 -26.1 → -0.16, 0380 -19.9 → +1.0). Eval headline 44.9% → 45.0%, mean |err| 1.82 → 1.76, mean signed -0.08 → +0.02. A few storage certs overshoot (other residuals the standard rate was masking). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| applications | ||
| domain | ||
| infrastructure | ||
| orchestration | ||
| repositories | ||
| utilities | ||
| __init__.py | ||
| conftest.py | ||
| test_lambda_packaging.py | ||