github springfall2008/batpred v8.36.0
Marginal energy cost tracking

6 hours ago

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; the matrix attribute 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_cheapon when the marginal cost for that load level is at or below rate_min × 1.2.
  • binary_sensor.predbat_marginal_rate_now_{low|med|high|ev}_is_moderateon when the cost is above cheap but within max(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.

image

New MarginalCosts chart page

The web interface gains a MarginalCosts chart tab with three sections:

  1. A status table showing cheap/moderate status (colour coded green/yellow) for each load level right now.
  2. A compact Grid Rates heatmap — actual import and export rates across the seven forecast windows.
  3. A Marginal Energy Cost heatmap — the full 4×7 matrix coloured green (cheap) through red (expensive) on a shared scale.
  4. 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.
image

Full Changelog: v8.35.7...v8.36.0

Don't miss a new batpred release

NewReleases is sending notifications on new releases.