Skip to content

Savings/Insights chart plots buy price only, not sell/export price #232

Description

@johanzander

Summary

The Savings/Insights price chart only plots the import (buy) price line. For contracts where export/sell price diverges significantly from import price — e.g. Belgian dynamic contracts (Luminus/Belpex) where sell price can go negative at midday while buy price stays well above zero — this makes it impossible to visually understand why the optimizer scheduled an export or held back a discharge.

Reported in

#126 — user on ENTSO-e/Belpex (Luminus Dynamic) reported the chart line tracks buy price only (dips ~€0.21 midday, peaks ~€0.37 evening), which doesn't reflect that export/injection compensation was negative at those same midday hours.

Evidence

frontend/src/components/BatteryLevelChart.tsx — every price reference in the chart's data pipeline reads hour.buyPrice; there is no sellPrice field anywhere in the file:

53:    if (hour.buyPrice === undefined) {
54:      console.warn(`Missing key: buyPrice at index ${index}`);
68:    const rawPrice = getValue(hour.buyPrice);
100:      buyPriceFormatted: hour.buyPrice
118:      const rawPriceTmrw = getValue(hour.buyPrice);
148:        buyPriceFormatted: hour.buyPrice
230:    <p>Electricity Price : {data.buyPriceFormatted?.text ?? `${data.price}`}</p>

Sell price is available elsewhere in the app (e.g. DetailedSavingsAnalysis.tsx shows it as a "Price Buy/Sell" text column), so the data exists in the API response — it's just never fed into this chart's series.

Suggested fix direction

Add a second price series (sell/export price) to the chart, distinctly styled from the buy-price line, so users on asymmetric-price contracts can see both curves the optimizer is actually weighing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bot-analyzedTriage bot has processed this issueenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions