evcc icon indicating copy to clipboard operation
evcc copied to clipboard

The optimizer ignores the vehicle SoC limit.

Open 404GamerNotFound opened this issue 2 months ago • 4 comments

Describe the bug

When the vehicle SoC is set to 80%, the optimizer never factors this value into its calculations. In my view, the vehicle SoC should be taken into account here—or rather, the lower of the two values ​​(either the vehicle SoC or the EVCC setting) should be used.

Image Image

Steps to reproduce

  1. Set SoC to 80%
  2. go to optimizer page

Configuration details

/

Log details

/

What type of operating system or environment does evcc run on?

Linux

External automation

  • [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • [x] I have verified that the issue is reproducible with the latest nightly build

Version

evcc version 0.315.0

404GamerNotFound avatar Sep 12 '26 05:09 404GamerNotFound

Thanks for the report. This matches a known, documented gap in the code rather than a regression.

effectiveLimitSoc() in core/loadpoint_effective.go (used by the optimizer via EffectiveLimitSoc() in core/site_optimizer.go to derive the vehicle's SMax for the optimization) only considers:

  • the loadpoint's own configured limit soc (lp.limitSoc), and
  • evcc's own vehicle setting (vehicle.Settings(...).GetLimitSoc()).

It does not consider a charge limit reported natively by the vehicle itself via its API (api.SocLimiter.GetLimitSoc(), e.g. as used for some brands to display "vehicle SoC limit" in the UI). This is called out explicitly in the code:

// effectiveLimitSoc returns the effective session limit soc
// TODO take vehicle api limits into account
func (lp *Loadpoint) effectiveLimitSoc() int {

So if the 80% limit you're referring to is a limit configured on the vehicle/car side (reported through its API) rather than set in evcc's own loadpoint/vehicle settings, the optimizer indeed won't factor it in yet — exactly as you describe. Your suggestion (using the lower of the two values) matches the intent of that TODO.

This is a known missing feature rather than a defect in existing logic, so I'm not marking it as a bug, but leaving it as an enhancement request to implement the TODO.

🤖 Generated with Claude Code

github-actions[bot] avatar Sep 12 '26 05:09 github-actions[bot]

I had the same issue. And it was related to the option ‘Allow battery feed-in to the grid’ in the home battery section.

I think (huge guess, I’m no programmer) that it has to do something with costs, whereas the optimizer concludes that feed-in to the grid is financially more beneficial than charging the EV. I hope this will get sorted later when EVCC will put more develop into the optimizer.

jjbolhuis avatar Sep 12 '26 08:09 jjbolhuis

@jjbolhuis the issue is about vehicle, not about home battery.

andig avatar Sep 13 '26 11:09 andig

@404GamerNotFound you'll need to align your evcc setting with your vehicle settings. This has really nothing to do with optimizer, it's just that vehicle settings are information-only atm.

andig avatar Sep 13 '26 11:09 andig