Repository navigation
Energy: split flow chart loadpoints into charging and heating - #36114
Conversation
There was a problem hiding this comment.
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>|
Show heating in reddish color like on the optimizer page? |
|
In sanky coloring comes from the sources. Same as in the energy flow bar on main. |
|
I don't understand. It seems to come from the sinks- at least partially looking at grid export. Not possible to color heating differently? |
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): 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. |
|
Love to see this. 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. |
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. |


follows #36111 #36076
The energy flow chart shows charging and heating as two dedicated sinks instead of one combined loadpoint sink.
Screenshots
🤖 Generated with Claude Code