← Projects

Energy dispatch engine

Software ·

A dispatch engine for solar-plus-storage sites, with a simulator: it recovers wasted solar and lowers the cost of energy bought from the grid.

  • Python
  • pytest
  • matplotlib

The problem

A solar plant with a battery wastes energy on sunny days, when the battery is full and the panels get throttled, and pays too much on cloudy ones, when it buys from the grid in the wrong tariff band.

What it does

A single control loop, with no “summer” or “winter” mode, decides from three signals: tariff, solar forecast and battery state of charge. On sunny days it diverts the surplus to a useful load; on dull ones it shifts unavoidable purchases into the off-peak band. A simulator compares it with an unmanaged plant over synthetic weeks.

Results (simulation, 7 days, 20 kWh battery, 10 kWp)

  • Winter: grid energy bought 34% cheaper (0.100 vs 0.152 €/kWh).
  • Summer: +130 kWh of solar recovered; self-consumption from 19% to 41%.
  • Mixed season: +92 kWh recovered; self-consumption from 41% to 65%.

Pure standard-library Python, fully unit-tested. It comes from a real controller for an off-grid-capable plant, with the client-specific logic removed.