What's Changed
Marginal Energy Cost Matrix
Predbat now calculates the marginal cost of energy — how much each extra kWh of consumption will actually cost you at different times and load levels, based on the current optimised plan.
After each plan run, Predbat simulates consuming an additional 1, 2, 4 or 8 kWh (representing low, medium, high and EV-scale loads) across seven upcoming time windows (now through +12 hours in 2-hour steps). The delta against the baseline plan gives the true marginal cost in p/kWh, accounting for battery dispatch, solar, and tariff interactions.
New Home Assistant sensors
sensor.predbat_marginal_energy_costs— state is the 1 kWh marginal cost right now; thematrixattribute contains the full 4×7 cost table, grid import/export rates per window, and per-level cost-now values.binary_sensor.predbat_marginal_rate_now_{low|med|high|ev}_is_cheap—onwhen the marginal cost for that load level is at or belowrate_min × 1.2.binary_sensor.predbat_marginal_rate_now_{low|med|high|ev}_is_moderate—onwhen the cost is above cheap but withinmax(rate_max × 0.5, rate_min × 1.5).
These binary sensors are ideal for automations — start an EV charge, dishwasher, or hot water boost only when energy is genuinely cheap for the amount of energy your device will use.
New MarginalCosts chart page
The web interface gains a MarginalCosts chart tab with three sections:
- A status table showing cheap/moderate status (colour coded green/yellow) for each load level right now.
- A compact Grid Rates heatmap — actual import and export rates across the seven forecast windows.
- A Marginal Energy Cost heatmap — the full 4×7 matrix coloured green (cheap) through red (expensive) on a shared scale.
- A history & forecast line chart — seven days of recorded marginal rates and grid import/export rates, with the current matrix values plotted forward in time.
- feat: Marginal energy cost matrix — heatmap chart + HA sensors by @springfall2008 in #3751
Full Changelog: v8.35.7...v8.36.0