v5.9.0 – Per-billing-period tracking & accurate cost accounting
Highlights
Track energy cost per billing period with figures that match your actual bill — and that don't drift when the ENGIE price changes.
Added
- Billing-period history — each contract year is recorded with its consumption (kWh, m³) and a frozen cost captured at close, so closed periods always match what you were billed. New sensors:
*_billing_period_historyand*_cost_this_billing_periodfor electricity and gas. - Close a billing period — manual or automatic. Services
close_electricity_billing_period/close_gas_billing_period(with optionalperiod_endfor backdating early meter reads) and matchingundo_*services. Periods also roll over automatically on the contract anniversary (a manual early close suppresses the automatic one). - Period-end date pickers (
dateentities) to set the exact billing-period end before closing. - Continuous cost accumulator —
*_cost_accumulatedsensors price each kWh at the rate in force when it was consumed (like the HA Energy dashboard), so they don't re-price history. Accurate from first run; not retroactive. - Ready-made dashboard at
dashboards/belgium_energy_costs_dashboard.yaml(built-in cards only) with a year-over-year comparison table. See the file header for import + the one required entity-ID edit.
Notes
- Electricity and gas are tracked independently (different anniversaries supported).
- Everything is additive and fail-safe — a failure in the new code is logged and skipped, leaving the core cost sensors unaffected.
- Existing entity IDs are unchanged; dashboards and history carry over.
- The accumulator counts forward from when you update; past periods are covered by the frozen history.