> For the complete documentation index, see [llms.txt](https://docs.voltmasters.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.voltmasters.io/control-algorithms/self-supply.md).

# Self-supply

**Self-supply** maximizes the use of your own energy on site. Instead of optimizing for price, it keeps the **net exchange with the grid close to zero**: surplus PV is stored in the battery and discharged again to cover consumption.

## How it works

Every control cycle the algorithm:

* **Balances against the grid.** It measures the power at the grid connection point and steers the battery to bring that net exchange towards zero, charging when there is export (PV surplus), discharging when there is import (consumption the PV cannot cover).
* **Uses a deadband.** Small grid fluctuations within a configurable deadband are ignored, so the battery does not chase every minor change.
* **Runs PV at full power**, except when the **injection price is negative**: then controllable PV inverters are curtailed so that production does not exceed what is consumed and stored locally, avoiding paying to export.
* **Manages EV charging** as part of the same decision. Controllable loads are not actively managed in this mode.

Unlike cost optimization, self-supply does not build a forward price-based plan. It balances the installation in real time against the measured grid power.

## Relationship to an external signal

Like cost optimization, self-supply is a **local** strategy. When an [external signal](/external-signal/external-signal.md) partner is actively steering the battery, that partner takes precedence; self-supply runs when no external signal is active.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.voltmasters.io/control-algorithms/self-supply.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
