evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Optimizer: derive per-device action suggestions from result

Open andig opened this issue 5 months ago • 2 comments

Replaced reverted https://github.com/evcc-io/evcc/pull/30783

Converts the optimizer schedule into a per-device advisory action for the current slot, surfaced alongside the existing evopt-batteries payload. Advisory only — control (loadpoint/battery) is intentionally not wired up yet.

Because the optimization is linear, the first slot sits at an operating-range extreme, so it maps cleanly onto the discrete action that control would later apply. An idle battery is interpreted from the grid flow:

  • home battery: charge (charging while importing from grid), hold (idle while importing, i.e. discharge withheld), holdcharge (idle while exporting, i.e. charging withheld), else normal
  • loadpoint/vehicle: charge / stop
  • plus the raw recommended charge/discharge power (W)

batteryResult gains a suggestion field; no new publish topic and no change to requiredBatteryMode() or loadpoint.Update().

TODO

  • [ ] expose in UI @naltatis

andig avatar Jun 14 '26 09:06 andig

@copilot resolve the merge conflicts in this pull request

naltatis avatar Jun 25 '26 14:06 naltatis

@copilot resolve the merge conflicts in this pull request

Resolved by merging origin/master into this branch and fixing the conflict in core/site_optimizer_test.go. Included in commit 014accd.

Copilot avatar Jun 25 '26 14:06 Copilot

Created UI for battery and loadpoints. Updated publishing structure. See description and screenshots above,.

naltatis avatar Jul 02 '26 06:07 naltatis

Following this with interest. It looks like the direction that would replace a workaround I'm running.

I have a Vaillant aroTHERM heat pump modelled as a heating loadpoint (SoC = DHW tank temperature), PV-only + dynamic tariff + smartCostLimit, no EV. Two behaviours I currently emulate with a small external script that just flips the loadpoint's limitSoc via the API:

  1. source-dependent target: store to 60 °C only from PV surplus, cap grid/smartCost heating at 50 °C (the last 10 K are the worst COP band, and on grid they're pure loss vs. feed-in);
  2. forecast gate: don't grid-charge in the morning if the solar forecast says PV will cover the tank for free later today.

Both are exactly what a price+forecast optimizer should decide on its own, so I'd rather drop the script.

Will the per-slot suggestions (and later the wired-up control) extend to heating/thermal loadpoints, where "SoC" is a tank temperature and the store is thermal rather than a battery/EV? Or is the initial scope battery + EV only? Happy to test on a real thermal + PV + dynamic-tariff system if that's useful.

Johannes-del avatar Jul 06 '26 07:07 Johannes-del

NICE!

andig avatar Jul 10 '26 14:07 andig