Skip to content

bug(planner): arbitrage exports live PV surplus while planning later grid charge #519

Description

@frahlg

Bug Description

Community support report: in arbitrage mode, the live UI can show PV surplus being exported while the battery is only lightly charging, even though the plan later schedules full-power cheap grid charging.

This looks economically wrong when export value is lower than the later import cost plus round-trip losses: live PV surplus should usually be absorbed before scheduling later grid import, unless SoC/charge caps/fuse constraints or export price explicitly make export better.

Observed Example

From Discord support thread, after updating from v0.120.9 to current release:

  • Mode: arbitrage
  • Solar: 4.20 kW
  • House: 1.58 kW
  • EV charger: 0 W
  • Battery: charging ~1.30 kW, target ~1.4 kW, SoC 12%
  • Grid: exporting ~1.32 kW

Energy balance matches: 4.20 kW PV - 1.58 kW load - 1.30 kW battery charge ≈ 1.32 kW export. Operator reports the plan later intends to charge at full effect / buy cheap.

Expected Behavior

In planner_cheap/planner_arbitrage, live PV surplus should not be exported while the battery has charge headroom and the plan intends later grid charging, unless export is economically better after fees/taxes/round-trip losses or a safety/SoC/fuse constraint blocks charging.

Actual Behavior

The energy-dispatch path appears to follow the per-slot planned Wh target (~1.4 kW) and can export remaining live PV surplus until the next replan, even when later slots include grid charging.

Notes

This may need either:

  1. an MPC objective/constraint improvement so same-horizon PV surplus is valued against avoided later imports; and/or
  2. a live opportunistic surplus-absorb rule for planner_cheap/planner_arbitrage that increases charge target up to available PV surplus when doing so reduces later planned grid charge.

Related historical issues: #153/#167 discuss planner_self live surplus behavior, but this report is about arbitrage/cheap energy-dispatch and planned later grid charging.

Environment

  • User had been on v0.120.9, then updated before this observation. Exact post-update version/commit not yet captured.
  • Hardware details not yet captured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions