> For the complete documentation index, see [llms.txt](https://docs.unwaste.energy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unwaste.energy/en/unwaste-robot-operation/energy-flow-calculation-and-balancing.md).

# Energy flow calculation and balancing

Learn how Unwaste calculates and balances energy flows in an installation.

### Why balancing is needed

Real installations are rarely fully metered at every point.\nUnwaste models energy flow as a graph of connected elements (connection → circuits → devices), but:

* some devices may not have meters,
* some circuits may have meters while sub-devices also have meters,
* production and storage can be bidirectional relative to circuits.

To keep the model understandable, Unwaste applies balancing rules that prioritize:

* measured values where available,
* and residual handling where measurement is incomplete.

### Net flow principle

For any connection between two nodes, Unwaste can compute net flow for the chosen period:

* if energy can flow in both directions, net flow is the difference between the two directions.

This is why you see one arrow per connection, not two arrows.

### Unmetered usage as residual

When a circuit meter exists, Unwaste can compare:

* total energy reported by the circuit meter, vs
* sum of energy attributed to metered sub-elements.

If the circuit meter is higher, the difference is shown as **unmetered usage**.

Unmetered usage therefore means:

* "energy that passed through this circuit, but is not explained by known metered elements below it."

### Why negative residual is hidden

A negative residual can occur if production exists "below" a circuit but is not separately metered in the expected way.\nDisplaying "unmetered usage producing energy" is misleading for most users, so negative residual is suppressed.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.unwaste.energy/en/unwaste-robot-operation/energy-flow-calculation-and-balancing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
