For the complete documentation index, see llms.txt. This page is also available as Markdown.

Selling energy to the grid

Discharging the battery to the grid to sell stored energy when the injection price is high, an optional extension of cost optimization.

Under cost optimization the battery normally discharges to cover the site's own consumption, using stored energy instead of buying expensive grid energy. Selling energy to the grid (also called battery injection sales or discharge to grid) is an optional extension: when the injection (feed-in) price is high enough to be profitable, the EMS discharges stored energy into the grid to earn revenue, on top of self-supply.

Enabling it

Selling energy to the grid is a per-project setting. Enable the Battery injection sales toggle under Project settings.

  • Disabled (default): the battery is never discharged just to feed the grid. Cost optimization only stores cheap/solar energy and releases it to cover the site's own deficits.

  • Enabled: the cost-optimization planner additionally looks for profitable moments to inject stored energy into the grid, and plans extra discharge for them.

It only has an effect while the project runs cost optimization and no external signal partner is steering the installation.

Two ways to sell

Energy is always sold at the most profitable moments: the planner ranks the candidate slots by injection price and serves the highest price first. What differs between the two modes is how much of the battery is offered for sale.

1. Selling surplus energy

Part of what the battery stores is not needed for the site's upcoming consumption; that is surplus (for example, more solar was stored during the day than the evening will use). The surplus is sold at the moment the injection price peaks. This is the baseline behaviour whenever injection sales are enabled.

2. Selling beyond the surplus: price arbitrage

Energy that the plan would otherwise keep to cover a later deficit (so it can avoid buying at the future consumption price) can be sold too, but only when it clearly pays off: when the injection price now is more than the minimum price difference above that later consumption price. In that case the kilowatt-hour earns more sold now than it would save later, so the planner exports it and meets the later need from the grid instead.

How it looks

Selling energy to the grid: market price, battery state of charge and energy destinations over a day
Over a day the battery charges on cheap/solar energy (1: store surplus) and powers the site through the day (2: self-consumption). In the highest-price window it injects extra energy to the grid (3): the surplus always (Mode 1), and, when the injection price beats the later consumption price by more than the minimum price difference, energy that would otherwise have been kept for later (Mode 2).

When a slot qualifies

The amount available for selling is budgeted per recharge segment (roughly per PV cycle/day): each segment can offer the energy it starts with plus its expected PV surplus, minus the deficits it must still cover and any reserve. A segment never sells energy that belongs to another, which keeps multi-day plans stable.

Within that budget, a slot is only used to sell when all of these hold:

  • the injection price is positive and clears the minimum price difference (so the sale covers round-trip losses and battery wear);

  • the consumption price is not negative (a negative price means it is cheaper to charge);

  • the slot is not already a charging slot (a battery cannot charge and discharge at once);

  • the slot is not in the last four hours of the forecast (too uncertain to commit storage to);

  • there is energy above the reserve (the effective minimum state of charge, including any EV power-boost reserve), and the export stays within the grid connection's injection limit.

Safeguards

Selling to the grid never runs away with your battery or your money:

  • Profit margin: the minimum price difference guarantees every sale clears the round-trip loss and cycle wear.

  • Reserve & minimum SoC: discharging stops at the effective minimum; reserves (such as an EV power-boost reserve) are off-limits.

  • Forecast tail exclusion: no injection is planned in the final four hours of the horizon.

  • Grid export limit: battery injection and PV export share one export budget, capped at the connection's injection limit.

  • Self-supply first: energy is only sold when selling beats self-use; covering your own consumption otherwise takes priority.

See also

Last updated