evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Epic: Improve experimental optimizer

Open andig opened this issue 4 months ago • 12 comments

With https://github.com/evcc-io/evcc/pull/22495 merged, we're using this as tracking issue for more optimizer capabilities

Model capabilities:

  • [x] EV fixed charge demand step (model Min+PV and Fast charging) https://github.com/andig/evopt/pull/4
  • [x] EV min/max charge power (if charging) bdd1857278b06b5ca0db13bf18e2f815c4388c1f
  • [x] EV charge goal (model charging plan goals) bdd1857278b06b5ca0db13bf18e2f815c4388c1f
  • [x] Battery grid charging (https://github.com/andig/evopt/pull/3)
  • [x] Battery max charge/discharge power https://github.com/evcc-io/evcc/pull/22944 (only custom)
  • [x] Forced grid charging
  • [x] Battery soc limits https://github.com/evcc-io/evcc/pull/23429
  • [ ] PV AC limitation
  • [ ] Grid Feed-in limitation/ peak shaving
  • [ ] Grid Consumption/ Load management restrictions
  • [ ] Loadpoint priorities
  • [x] End of forecast financial value

Blocked (missing parameters):

  • [ ] Battery charge goal

Improvements

  • [x] charge before exporting https://github.com/andig/evopt/pull/6
  • [ ] fix batteries flip-flopping

NOTE: at this time, the optimizer is purely information-only ("what would happen if we actually used this"). It is not used to make actual decisions.

andig avatar Aug 17 '25 09:08 andig

Another wishlist item, longterm:

Get from vehicle API: destination, SoC when arriving at destination and ETA destination. If destination is the location of EVCC (='home'), use the SoC in the optimizer, to prepare for the EV to arrive. (maybe already prepare the planner)

(For Tesla or Tessie, I know it is easy to get this data from the API)

djfanatix avatar Aug 28 '25 07:08 djfanatix

Excellent project !

Optimizer should focus on the overall energy management for the battery in the house. In this model the car is just another dependency to take into account when planing for the house battery charge. We have plenty of functionality to plan and optimise the car charging already in evcc but we do lack the energy management for the house battery.

The battery in the house is the often the bottleneck because most installations do have a battery capacity of 10 kWh which normally is exceeded by the consumption in the winter time if you do operate a heat pump. Your daily consumption on a cold day can vary from 10 - 25 kWh depending on the efficiency.

Heat pump will be added into the daily house forecast and then the need is to charge the battery from grid and solar before the grid price peaks during the day. This can easily result in multiple (2-3) charging cycles during the day in order to drive needed savings.

I would be good to calculate the average kWh price of the current battery load to understand at what price level it is cheaper to depend on the battery and when we have a favourable price level for the battery grid reloading. I saw that you already have an efficiency of 90% planed for the battery consumed energy which reflects the loss of the system.

From an algorithm side in the winter it is less about achieving a certain SOC on the house battery but more about tapping into the lowest grid prices and leverage the stored energy to offset peak pricing. You need to stretch the battery load over the peak price hours efficiently.

rafdev18 avatar Sep 13 '25 15:09 rafdev18

In summer, "PV AC limitation" would be a very useful feature for new systems. We have to reduce the feed-in power to 60%. This means the battery should only be charging in the noon hours with the surplus that cannot be fed in and maybe in the afternoon. This topic is also discussed here: https://github.com/evcc-io/evcc/discussions/18510

SMA has such a feature and I think other inverters as well. But in the case of SMA, if "prognosebasiertes Laden" is enabled, I have seen forced grid charging controlled by evcc to be interupted, then starting again and so on. So it's better if there is just one brain.

Kiechlus avatar Sep 15 '25 17:09 Kiechlus

That‘s peak shaving. AC limitation is lower AC than DC power.

andig avatar Sep 15 '25 17:09 andig

Thanks. In this case both of them would be very useful on my setup.

Kiechlus avatar Sep 15 '25 18:09 Kiechlus

Hi @andig, thanks for your outstanding work regarding the Optimizer. I would like to give it a try and hand over control to the optimizer. When can we expect that this possibility is given and Optimizer is not "information only"?

From my point of view, the results and plans, the optimizer creates are better than any other optimization method, I have at hand.

dsgrafiniert avatar Oct 06 '25 09:10 dsgrafiniert

Hi @andig, thanks for your outstanding work regarding the Optimizer. I would like to give it a try and hand over control to the optimizer. When can we expect that this possibility is given and Optimizer is not "information only"?

Second that. It's autumn, low solar production, so any kind of better grid charge management without external integration would be superb.

I can schedule charging my battery from grid on inverter - but that makes evcc go crazy: battery 100%, we have surplus, so lets charge a car! :) And I end up with my car charging even if I do not want to.

redzioch avatar Nov 12 '25 19:11 redzioch

Pls open new issue

andig avatar Nov 12 '25 19:11 andig

Pls open new issue

It's OK, I understand why evcc behaves like that. My goal was to encourage you to give evopt a try.

redzioch avatar Nov 12 '25 19:11 redzioch

I do, too, but it still might be fixable. But certainly NOT in this issue.

andig avatar Nov 12 '25 21:11 andig

From my point of view, the results and plans, the optimizer creates are better than any other optimization method, I have at hand.

I agree. Recently got new home battery system with Victron inverters and the optimizer preview result seems much better than the one provided by inverter (DESS). Would really like to try this in instead :-)

dlt- avatar Dec 08 '25 18:12 dlt-

Maybe @konstantinschubert wants to share his integration (https://github.com/evcc-io/evcc/issues/25562#issuecomment-3580736852)

andig avatar Dec 08 '25 19:12 andig