evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Home Battery: MaxSoC not honored

Open schnabelewobski opened this issue 9 months ago • 3 comments

Describe the bug

#27529 is not solved. Battery maxSoC is not honored when it is reached during normal operations. However, when evcc is started while SoC>=maxSoC, it is honored.

Guess: Either hold-command is not being sent or not reaching the inverter/battery.

It seems logs are not sufficient in this case. Which data could help analyzing evcc's behavior?

Steps to reproduce

  1. Set MaxSoC to 80%
  2. Set Battery to charge when energy prices are below a certain threshold
  3. Watch battery being charged when energy prices are low
  4. Charging will not stop even though logs say battery is set to hold mode when MaxSoC is reached.
  5. When evcc is restarted after MaxSoC is reached, charging is stopped and MaxSoC is honored.

Configuration details

{
  "site": {
    "title": "",
    "grid": "db:7",
    "pv": ["db:6","db:9"],
    "battery": ["db:18"],
    "aux": null,
    "ext": null
  },
  "loadpoints": [
    {"id":12,"name":"db:12","charger":"db:11","vehicle":"db:10","title":"Heizungskeller","defaultMode":"pv","priority":0,"phasesConfigured":1,"minCurrent":12,"maxCurrent":12,"smartCostLimit":0.08,"smartFeedInPriorityLimit":null,"planEnergy":0,"planTime":"0001-01-01T00:00:00Z","planPrecondition":0,"batteryBoostLimit":100,"limitEnergy":0,"limitSoc":0,"planStrategy":{"continuous":false,"precondition":0},"thresholds":{"enable":{"delay":60000000000,"threshold":0},"disable":{"delay":180000000000,"threshold":0}},"soc":{"poll":{"mode":"charging","interval":3600000000000},"estimate":false}}
  ],
  "charger": [
    {"config":{"channel":"0","heating":true,"host":"192.168.42.88","icon":"","integrateddevice":true,"standbypower":"15","template":"shelly"},"id":11,"name":"db:11","type":"template"}
  ],
  "meter": [
    {"config":{"channel":"0","host":"192.168.42.68","password":"***","template":"shelly-1pm","usage":"pv","user":"***"},"deviceTitle":"Gartenzaun","id":9,"name":"db:9","type":"template"},
    {"config":{"capacity":11,"endianness":"little","host":"192.168.42.7","id":71,"maxacpower":"0","maxchargerate":"100","modbus":"tcpip","port":"1502","template":"kostal-plenticore-gen2","usage":"pv","watchdog":"60s"},"deviceTitle":"Dach","id":6,"name":"db:6","type":"template"},
    {"config":{"baudrate":9600,"capacity":11,"comset":"8N1","endianness":"little","host":"192.168.42.7","id":71,"maxacpower":"0","maxchargepower":1600,"maxchargerate":80,"maxdischargepower":2800,"maxsoc":80,"minsoc":5,"modbus":"tcpip","port":1502,"template":"kostal-plenticore-gen2","usage":"battery","watchdog":"60s"},"deviceProduct":"Kostal Plenticore Hybrid, inkl. Netzladung der Hausbatterie","deviceTitle":"BYD Batterie","id":18,"name":"db:18","type":"template"},
    {"config":{"host":"192.168.42.9","id":71,"modbus":"tcpip","template":"kostal-ksem","usage":"grid"},"id":7,"name":"db:7","type":"template"}
  ],
  "vehicle": [
    {"config":{"icon":"heater","mode":"pv","template":"offline","title":"Warmwasser"},"id":10,"name":"db:10","type":"template"},
    {"config":{"cache":"15m","capacity":77,"icon":"car","maxCurrent":16,"minCurrent":6,"mode":"pv","password":"***","phases":"","priority":10,"template":"vw","timeout":"10s","title":"id.3 Pro S","user":"***","vin":"***","welcomecharge":false},"deviceProduct":"Volkswagen We Connect ID","id":15,"name":"db:15","type":"template"}
  ],
  "tariffs": "currency: \"\"

#grid:
#  type: template
#  template: octopus-de
#  email: # E-Mail-Adresse, Die E-Mail-Adresse Ihres Octopus Energy Kontos.
#  password: *****
#  accountNumber:  # Kundennummer, Ihre Octopus Energy Kundennummer (z.B. A-12345678).

grid:
  type: fixed
  price: 0.3165 # EUR/kWh (default)
  zones:
      - days: Mo-So # Montag bis einschließlich Sonntag
        hours: 0-5 # 00:00 bis 05:00 Uhr
        price: 0.1965 # EUR/kWh
  #    - days: Sa,So
  #      price: 0.15 # EUR/kWh

feedin:
    type: fixed
    price: 0.068
co2:
    type: grünstromindex
    zip: *****
planner:
    type: \"\"
solar:
  - type: template
    template: solcast
    site: a3ed-1043-f3e1-b557
    token: *****
    interval: 6h
  - type: template
    template: solcast
    site: e899-5ef8-1326-decb
    token: *****
    interval: 6h",
  "modbusproxy": [],
  "mqtt": {"broker":"xxx:1883","user":"mqtt_evcc","password":"***","clientID":"","insecure":false,"caCert":"***","clientCert":"***","clientKey":"***","topic":"evcc"},
  "influx": {"url":"http://192.168.42.30:8086","database":"evcc","token":"***","org":"htown","user":"","password":"","insecure":false},
  "shm": {"vendorId":"","deviceId":""},
  "interval": 10,
  "experimental": true
}

Log details

[site  ] DEBUG 2026/02/20 02:24:45 ----
[lp-2  ] DEBUG 2026/02/20 02:24:45 charge power: 0W
[lp-2  ] DEBUG 2026/02/20 02:24:45 charge currents: [0 0 0]A
[lp-1  ] DEBUG 2026/02/20 02:24:45 charge power: 0W
[lp-1  ] DEBUG 2026/02/20 02:24:45 charge currents: [0.026 0.026 0.027]A
[site  ] DEBUG 2026/02/20 02:24:45 grid power: 2148W
[site  ] DEBUG 2026/02/20 02:24:45 grid powers: [716 784 647]W
[site  ] DEBUG 2026/02/20 02:24:45 pv 2 power: 4W
[site  ] DEBUG 2026/02/20 02:24:45 grid currents: [3.26 3.44 2.9]A
[site  ] DEBUG 2026/02/20 02:24:45 battery 1 power: -1608W
[site  ] DEBUG 2026/02/20 02:24:46 battery 1 soc: 81%
[site  ] DEBUG 2026/02/20 02:24:46 pv 1 power: 0W
[site  ] DEBUG 2026/02/20 02:24:46 pv power: 4W
[site  ] DEBUG 2026/02/20 02:24:46 !! solar production: accumulate set db:6 36145.930kWh meter total (was: Accumulated: 994.045kWh updated: 2026-02-20 02:24:36 +0100 CET meter: 36145.930kWh)
[site  ] DEBUG 2026/02/20 02:24:46 !! solar production: accumulate moved db:6 from 994.045 to 994.045
[site  ] DEBUG 2026/02/20 02:24:46 !! solar production: accumulate set db:9 20.531kWh meter total (was: Accumulated: -68.261kWh updated: 2026-02-20 02:24:36 +0100 CET meter: 20.531kWh)
[site  ] DEBUG 2026/02/20 02:24:46 !! solar production: accumulate moved db:9 from -68.261 to -68.261
[site  ] DEBUG 2026/02/20 02:24:46 site power: 640W
[lp-2  ] DEBUG 2026/02/20 02:24:46 charge voltages: [229 0 0]V
[lp-2  ] DEBUG 2026/02/20 02:24:46 detected connected phases: 1p
[lp-2  ] DEBUG 2026/02/20 02:24:46 charge total import: 591.112kWh
[lp-2  ] DEBUG 2026/02/20 02:24:46 charger status: B
[lp-2  ] DEBUG 2026/02/20 02:24:46 charge final energy: 0.000kWh
[lp-2  ] DEBUG 2026/02/20 02:24:46 charge total import: 591.112kWh
[lp-2  ] DEBUG 2026/02/20 02:24:46 vehicle soc: 0%
[lp-2  ] DEBUG 2026/02/20 02:24:46 !! plan: plan time zero
[lp-2  ] DEBUG 2026/02/20 02:24:46 pv charge current: 0A = 0A + -2.78A (640W @ 1p)
[site  ] DEBUG 2026/02/20 02:24:46 solar forecast: accumulated 0.000Wh from 2026-02-20 02:24:36 +0100 CET to 2026-02-20 02:24:46 +0100 CET
[site  ] DEBUG 2026/02/20 02:24:46 solar forecast: produced 925.784
[site  ] DEBUG 2026/02/20 02:24:46 solar forecast: accumulated 980.549kWh, produced 925.784kWh, scale 0.944
[site  ] DEBUG 2026/02/20 02:24:47 battery BYD Batterie: limit soc reached (81 > 80)
[site  ] DEBUG 2026/02/20 02:24:47 set battery BYD Batterie mode: hold
[site  ] DEBUG 2026/02/20 02:24:55 ----
[lp-1  ] DEBUG 2026/02/20 02:24:55 charge power: 0W
[lp-1  ] DEBUG 2026/02/20 02:24:55 charge currents: [0.027 0.027 0.027]A
[lp-2  ] DEBUG 2026/02/20 02:24:55 charge power: 0W
[lp-2  ] DEBUG 2026/02/20 02:24:55 charge currents: [0 0 0]A
[site  ] DEBUG 2026/02/20 02:24:55 grid power: 2147W
[site  ] DEBUG 2026/02/20 02:24:55 pv 2 power: 4W
[site  ] DEBUG 2026/02/20 02:24:55 grid powers: [715 785 647]W
[site  ] DEBUG 2026/02/20 02:24:55 grid currents: [3.26 3.44 2.91]A
[site  ] DEBUG 2026/02/20 02:24:55 battery 1 power: -1607W
[site  ] DEBUG 2026/02/20 02:24:56 battery 1 soc: 81%
[site  ] DEBUG 2026/02/20 02:24:56 pv 1 power: 0W
[site  ] DEBUG 2026/02/20 02:24:56 pv power: 4W
[site  ] DEBUG 2026/02/20 02:24:56 !! solar production: accumulate set db:6 36145.930kWh meter total (was: Accumulated: 994.045kWh updated: 2026-02-20 02:24:46 +0100 CET meter: 36145.930kWh)
[site  ] DEBUG 2026/02/20 02:24:56 !! solar production: accumulate moved db:6 from 994.045 to 994.045
[site  ] DEBUG 2026/02/20 02:24:56 !! solar production: accumulate set db:9 20.531kWh meter total (was: Accumulated: -68.261kWh updated: 2026-02-20 02:24:46 +0100 CET meter: 20.531kWh)
[site  ] DEBUG 2026/02/20 02:24:56 !! solar production: accumulate moved db:9 from -68.261 to -68.261
[site  ] DEBUG 2026/02/20 02:24:56 site power: 640W
[lp-1  ] DEBUG 2026/02/20 02:24:56 charge voltages: [231 230 230]V
[lp-1  ] DEBUG 2026/02/20 02:24:56 detected connected phases: 3p
[lp-1  ] DEBUG 2026/02/20 02:24:56 charge total import: 2673.526kWh
[lp-1  ] DEBUG 2026/02/20 02:24:56 charger status: B
[lp-1  ] DEBUG 2026/02/20 02:24:56 !! plan: plan time zero
[lp-1  ] DEBUG 2026/02/20 02:24:56 pv charge current: 0A = 0A + -0.927A (640W @ 3p)
[site  ] DEBUG 2026/02/20 02:24:56 solar forecast: accumulated 0.000Wh from 2026-02-20 02:24:46 +0100 CET to 2026-02-20 02:24:56 +0100 CET
[site  ] DEBUG 2026/02/20 02:24:56 solar forecast: produced 925.784
[site  ] DEBUG 2026/02/20 02:24:56 solar forecast: accumulated 980.549kWh, produced 925.784kWh, scale 0.944
[site  ] DEBUG 2026/02/20 02:24:57 battery BYD Batterie: limit soc reached (81 > 80)
[site  ] DEBUG 2026/02/20 02:24:57 set battery BYD Batterie mode: hold

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

Docker container

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

0.301.0

schnabelewobski avatar Feb 20 '26 17:02 schnabelewobski

As suggested verify hold command.

andig avatar Feb 20 '26 22:02 andig

Kindly explain how I am supposed to do this when restarting evcc changes the situation.

Also, output of evcc meter was given in #27529 but you closed the issue without comment.

schnabelewobski avatar Feb 21 '26 00:02 schnabelewobski

Please don‘t double-post

andig avatar Feb 21 '26 10:02 andig