Skip to content

Energy: split flow chart loadpoints into charging and heating - #36114

Merged
andig merged 2 commits into
masterfrom
feat/energy-sankey-split
Nov 12, 2026
Merged

andig merged 2 commits into
masterfrom
feat/energy-sankey-split

Conversation

@naltatis

@naltatis naltatis commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

follows #36111 #36076

The energy flow chart shows charging and heating as two dedicated sinks instead of one combined loadpoint sink.

  • Each sink has its own total and source split, matching the charging and heating cards
  • A sink is only shown if it has data
  • Fixes a "ResizeObserver loop" error when resizing the window with a chart visible

Screenshots

CleanShot 2026-11-11 at 16 10 46@2x CleanShot 2026-11-11 at 16 09 49@2x

🤖 Generated with Claude Code

@naltatis naltatis added enhancement New feature or request ux User experience/ interface experimental Experimental feature heating Heating labels Nov 11, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="assets/js/components/Energy/mix.ts" line_range="72" />
<code_context>
+    for (const f of e.flows) {
+      const key = `${f.from}-${to}`;
+      const sum = sums.get(key) ?? { from: f.from, to, energy: 0 };
+      sum.energy += f.energy;
+      sums.set(key, sum);
+    }
</code_context>
<issue_to_address>
**Chart energy totals drift**

When entity flows are absent, omit loadpoints, or are rounded separately while aggregate loadpoint flows remain, `splitLoadpointFlows` sums rounded entity flows and removes the aggregate loadpoint flows, so the chart undercounts or omits energy when entity flows round down or are missing, and overcounts when they round up.

Reconcile entity-derived charging and heating flows with the aggregate loadpoint totals before removing the aggregate flows, preserving the totals when entity details are missing.

Also at `assets/js/components/Energy/mix.ts:76-79`.
</issue_to_address>

### Comment 2
<location path="assets/js/components/Energy/mix.ts" line_range="69" />
<code_context>
+  for (const e of entities ?? []) {
+    if (e.group !== "loadpoint") continue;
+    const to = heatingTitles.includes(e.title) ? "heating" : "charging";
+    for (const f of e.flows) {
+      const key = `${f.from}-${to}`;
+      const sum = sums.get(key) ?? { from: f.from, to, energy: 0 };
</code_context>
<issue_to_address>
**Energy goes to the wrong sink**

When a charging loadpoint and a heating loadpoint share a title, `splitLoadpointFlows` classifies loadpoints by title, and the flow API merges same-titled loadpoints, so charging and heating flows receive the same classification and the chart’s sink totals no longer match the cards.

Classify loadpoint flows using an identifier and temperature classification that distinguish same-titled loadpoints.

Also at `assets/js/views/Energy.vue:890`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread assets/js/components/Energy/mix.ts Resolved
Comment thread assets/js/components/Energy/mix.ts Resolved
@andig
andig merged commit cc2eec2 into master Nov 12, 2026
@andig
andig deleted the feat/energy-sankey-split branch November 12, 2026 07:11
@andig

andig commented Nov 12, 2026

Copy link
Copy Markdown
Member

Show heating in reddish color like on the optimizer page?

@naltatis

naltatis commented Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

In sanky coloring comes from the sources. Same as in the energy flow bar on main.

@andig

andig commented Nov 12, 2026

Copy link
Copy Markdown
Member

I don't understand. It seems to come from the sinks- at least partially looking at grid export. Not possible to color heating differently?

@naltatis

Copy link
Copy Markdown
Member Author

at least partially looking at grid export.

Yes, grid export is the exception where we attribute color by sink. This exception is in line with how the energy flow bar-diagram (main) does coloring.

For the usage (consumption, charging, heating, battery) the colors at the end terminal reflect the sources that fed them. This source color mix is also shown in the individual section further down the page (sources donut):

energy flow
CleanShot 2026-11-12 at 11 03 17@2x

charging chart
CleanShot 2026-11-12 at 11 05 04@2x

Adding an additional recoloring or tinting layer here (red shades for heating) is technically possible but would make the chart hard to understand and require extra explanations.

@docolli

docolli commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Love to see this.
However in my setup only my AC Thor is summarized in "Heating", not my Heatpump.

My Heatpump is defined as a user defined plug with YAML Code

enabled:
  source: const
  value: true
enable:
  source: js
  script: console.log(enable)
power:
  source: mqtt
  topic: open3e/CurrentElectricalPowerConsumptionSystem
  timeout: 60s
standbypower: 10

features:
  - heating
  - integrateddevice

icon: heatpump

I just want to monitor/Log my Heatpump power, not controlling it.
Should "features: heating" do the trick and it is seen as a heating device?

@naltatis

Copy link
Copy Markdown
Member Author

I just want to monitor/Log my Heatpump power, not controlling it.
Should "features: heating" do the trick and it is seen as a heating device?

Yes, the feature is what makes a regular load point a heating load point. Alternatively you can add you heat pump as a consumer. There is a per-device breakdown in the consumer section as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request experimental Experimental feature heating Heating ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants