Home Battery: Maxsoc not honored
Description
Hi,
I configured maxsoc for my home battery using the GUI and set it to 80%. However, the battery is charged to 100% when energy is cheap. I expect charging from grid to stop when the configured maxsoc is reached, even if energy prices are below a certain threshold.
Steps to Reproduce
Using the GUI, set maxsoc for the home battery to 80%. Configure charging from grid to start when energy prices are below a certain threshold. Charging from grid continues even when the home battery’s soc is above 80%.
Configuration (YAML)
# open evcc at http://evcc.local:7070
sponsortoken: *****
network:
schema: http
host: evcc.local # .local suffix announces the hostname on MDNS
port: 7070
log: debug
levels:
cache: error
# unique installation id
plant: *****
interval: 10s # control cycle interval
meters:
# - type: template
# template: kostal-plenticore-gen2
# id: 71
# host: 192.168.42.7
# port: 1502
# usage: pv
# modbus: tcpip
# name: pv1
# - type: template
# template: shelly-1pm
# host: 192.168.42.177
# name: Warmwasserkwh
# usage: charge
# - type: template
# template: shelly-1pm
# host: 192.168.42.68
# name: Zaun-PV
# usage: pv
# - type: template
# template: kostal-plenticore-gen2
# id: 71
# host: 192.168.42.7
# port: 1502
# usage: battery
# modbus: tcpip
# name: Batterie
# capacity: 11
# - type: template
# template: kostal-ksem-inverter
# id: 71
# host: 192.168.42.7
# port: 1502
# usage: grid
# modbus: tcpip
# name: grid3
# - name: my_grid
# type: template
# template: tibber-pulse
# usage: grid
# token: *****
- name: Wallbox
type: template
template: shelly-pro-3em
usage: charge
host: 192.168.42.176 # IP-Adresse oder Hostname
chargers:
- type: template
template: elliconnect
ski: *****
host: 192.168.42.136
name: wall-e
#- name: Warmwasser
# type: template
# template: shelly
# host: 192.168.42.177 # IP-Adresse oder Hostname
# integrateddevice: true
# icon: heater
#tariffs:
# grid:
# # either
# type: tibber
# token: *****
# feedin:
# type: fixed
# price: 0.068 # 0,12 [currency]/kWh
# co2:
# type: grünstromindex
# zip: *****
#vehicles:
#- type: template
# template: vw
# title: id3
# user: *****
# password: *****
# vin: *****
# capacity: 55
# timeout: 10s
# name: id3
loadpoints:
- title: Garage
charger: wall-e
mode: pv
vehicle: db:15
priority: 1
meter: Wallbox
#- title: Heizungskeller
# charger: Warmwasser
# mode: off
#phases: 1
# site:
# title: Mein Zuhause
# residualpower: 100
# meters:
# grid: grid3
# pv:
# - pv1
# - Zaun-PV
# battery:
# - Batterie
eebus:
certificate:
private: |
-----BEGIN EC PRIVATE KEY
(Deleted)
-----END EC PRIVATE KEY-----
(Deleted)
-----END CERTIFICATE-----
Configuration (UI)
{
"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
}
Logs
[site ] DEBUG 2026/02/20 03:52:16 battery 1 power: -3W
[site ] DEBUG 2026/02/20 03:52:16 battery 1 soc: 100%
[site ] DEBUG 2026/02/20 03:52:16 pv 1 power: 0W
[site ] DEBUG 2026/02/20 03:52:16 pv power: 4W
[site ] DEBUG 2026/02/20 03:52:16 !! solar production: accumulate set db:6 36145.930kWh meter total (was: Accumulated: 994.045kWh updated: 2026-02-20 03:52:06 +0100 CET meter: 36145.930kWh)
[site ] DEBUG 2026/02/20 03:52:16 !! solar production: accumulate moved db:6 from 994.045 to 994.045
[site ] DEBUG 2026/02/20 03:52:16 !! solar production: accumulate set db:9 20.537kWh meter total (was: Accumulated: -68.256kWh updated: 2026-02-20 03:52:06 +0100 CET meter: 20.537kWh)
[site ] DEBUG 2026/02/20 03:52:16 !! solar production: accumulate moved db:9 from -68.256 to -68.256
[site ] DEBUG 2026/02/20 03:52:16 site power: 4765W (including 2758W prioritized power)
[lp-1 ] DEBUG 2026/02/20 03:52:16 charge voltages: [230 227 230]V
[lp-1 ] DEBUG 2026/02/20 03:52:16 detected connected phases: 3p
[lp-1 ] DEBUG 2026/02/20 03:52:16 detected active phases: 3p
[lp-1 ] DEBUG 2026/02/20 03:52:16 session energy: 2.188kWh
[lp-1 ] DEBUG 2026/02/20 03:52:16 charge total import: 2675.714kWh
[lp-1 ] DEBUG 2026/02/20 03:52:16 charger status: C
[lp-1 ] DEBUG 2026/02/20 03:52:16 vehicle soc: 72%
[lp-1 ] DEBUG 2026/02/20 03:52:16 vehicle soc limit: 100%
[lp-1 ] DEBUG 2026/02/20 03:52:16 vehicle range: 295km
[lp-1 ] DEBUG 2026/02/20 03:52:16 soc estimated: 72.15% (vehicle: 72.00%)
[lp-1 ] DEBUG 2026/02/20 03:52:16 vehicle soc (estimator): 72%
[lp-1 ] DEBUG 2026/02/20 03:52:16 !! plan: plan time zero
[lp-1 ] DEBUG 2026/02/20 03:52:16 pv charge current: min 6A > 0A (4765W @ 3p, battery: true)
[site ] DEBUG 2026/02/20 03:52:16 solar forecast: accumulated 0.000Wh from 2026-02-20 03:52:06 +0100 CET to 2026-02-20 03:52:16 +0100 CET
[site ] DEBUG 2026/02/20 03:52:16 solar forecast: produced 925.789
[site ] DEBUG 2026/02/20 03:52:16 solar forecast: accumulated 980.549kWh, produced 925.789kWh, scale 0.944
Version
v0.301.0
System
linux/amd64, CET +01:00
Same here with Sungrow. @andig did we recently change something regarding maxsoc?
None I'm aware of. Of course this issue is missing a relevant logfile. It doesn't even show that any grid charging is going on at all.
A random snippet from the log when the battery was already > 80%:
[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
pls format
[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
looks fine?
Looks fine, but it just keeps charging.
Some time later:
[site ] DEBUG 2026/02/20 03:15:05 ---- [lp-1 ] DEBUG 2026/02/20 03:15:05 charge power: 0W [lp-1 ] DEBUG 2026/02/20 03:15:05 charge currents: [0.028 0.027 0.027]A [lp-2 ] DEBUG 2026/02/20 03:15:05 charge power: 0W [lp-2 ] DEBUG 2026/02/20 03:15:05 charge currents: [0 0 0]A [site ] DEBUG 2026/02/20 03:15:05 grid power: 2214W [site ] DEBUG 2026/02/20 03:15:05 grid powers: [720 805 689]W [site ] DEBUG 2026/02/20 03:15:05 pv 2 power: 4W [site ] DEBUG 2026/02/20 03:15:05 grid currents: [3.27 3.54 3.08]A [site ] DEBUG 2026/02/20 03:15:06 battery 1 power: -1608W [site ] DEBUG 2026/02/20 03:15:06 battery 1 soc: 95% [site ] DEBUG 2026/02/20 03:15:06 pv 1 power: 0W [site ] DEBUG 2026/02/20 03:15:07 pv power: 4W [site ] DEBUG 2026/02/20 03:15:07 !! solar production: accumulate set db:6 36145.930kWh meter total (was: Accumulated: 994.045kWh updated: 2026-02-20 03:14:56 +0100 CET meter: 36145.930kWh) [site ] DEBUG 2026/02/20 03:15:07 !! solar production: accumulate moved db:6 from 994.045 to 994.045 [site ] DEBUG 2026/02/20 03:15:07 !! solar production: accumulate set db:9 20.535kWh meter total (was: Accumulated: -68.258kWh updated: 2026-02-20 03:14:56 +0100 CET meter: 20.535kWh) [site ] DEBUG 2026/02/20 03:15:07 !! solar production: accumulate moved db:9 from -68.258 to -68.258 [site ] DEBUG 2026/02/20 03:15:07 site power: 706W [site ] DEBUG 2026/02/20 03:15:07 15min household consumption: 0Wh [lp-2 ] DEBUG 2026/02/20 03:15:08 charge voltages: [229 0 0]V [lp-2 ] DEBUG 2026/02/20 03:15:08 detected connected phases: 1p [lp-2 ] DEBUG 2026/02/20 03:15:08 charge total import: 591.112kWh [lp-2 ] DEBUG 2026/02/20 03:15:08 charger status: B [lp-2 ] DEBUG 2026/02/20 03:15:08 charge final energy: 0.000kWh [lp-2 ] DEBUG 2026/02/20 03:15:08 charge total import: 591.112kWh [lp-2 ] DEBUG 2026/02/20 03:15:08 vehicle soc: 0% [lp-2 ] DEBUG 2026/02/20 03:15:08 !! plan: plan time zero [lp-2 ] DEBUG 2026/02/20 03:15:08 pv charge current: 0A = 0A + -3.07A (706W @ 1p) [site ] DEBUG 2026/02/20 03:15:08 solar forecast: accumulated 0.000Wh from 2026-02-20 03:14:56 +0100 CET to 2026-02-20 03:15:08 +0100 CET [site ] DEBUG 2026/02/20 03:15:08 solar forecast: produced 925.787 [site ] DEBUG 2026/02/20 03:15:08 solar forecast: accumulated 980.549kWh, produced 925.787kWh, scale 0.944 [site ] DEBUG 2026/02/20 03:15:09 battery BYD Batterie: limit soc reached (95 > 80) [site ] DEBUG 2026/02/20 03:15:09 set battery BYD Batterie mode: hold
You can use
evcc meter
to check if the battery modes work. Stop evcc when testing.
Like this, you mean? Sorry, I'm not exactly a Docker pro.
docker run --rm -it --network host -v /volume2/docker/evcc/data:/root/.evcc -v /volume2/docker/evcc/config/evcc.yaml:/etc/evcc.yaml evcc/evcc:latest evcc meter
[main ] INFO 2026/02/20 16:41:21 using config file: /etc/evcc.yaml
[main ] INFO 2026/02/20 16:41:21 using sqlite database: /root/.evcc/evcc.db?_pragma=busy_timeout(5000)
[mqtt ] INFO 2026/02/20 16:41:21 connecting evcc-698232172 at tcp://mqtt.htown.de:1883
[mqtt ] DEBUG 2026/02/20 16:41:21 tcp://mqtt.htown.de:1883 connected
[eebus ] INFO 2026/02/20 16:41:21 Local SKI: 89d609e18b189cbce541c8f22910d097c7416b39
Power: 0W 192ms
Energy: 2676.5kWh 117ms
Current L1..L3: 0.028A 0.027A 0.027A
Voltage L1..L3: 230V 231V 232V
Power L1..L3: 0W 0W 0W
Total time: 309ms
[eebus ] ERROR 2026/02/20 16:41:22 websocket server error: http: Server closed
docker run --rm -it --network host -v /volume2/docker/evcc/data:/root/.evcc -v /volume2/docker/evcc/config/evcc.yaml:/etc/evcc.yaml evcc/evcc:latest evcc meter db:18
[main ] INFO 2026/02/20 16:47:06 using config file: /etc/evcc.yaml
[main ] INFO 2026/02/20 16:47:06 using sqlite database: /root/.evcc/evcc.db?_pragma=busy_timeout(5000)
[mqtt ] INFO 2026/02/20 16:47:06 connecting evcc-435348755 at tcp://mqtt.htown.de:1883
[mqtt ] DEBUG 2026/02/20 16:47:06 tcp://mqtt.htown.de:1883 connected
[eebus ] INFO 2026/02/20 16:47:06 Local SKI: 89d609e18b189cbce541c8f22910d097c7416b39
Power: -3W 317ms
Soc: 81% 235ms
Capacity: 11.0kWh
Min soc: 5%
Max soc: 81%
Charge power: 1600W
Discharge power: 2800W
Controllable: true
Total time: 552ms
[eebus ] ERROR 2026/02/20 16:47:08 websocket server error: http: Server closed
Just restarted the container for normal operations and now it's working?!
@andig This is not completed - it needs more research. There's no proper explanation for why it hasn't worked before. I will dig deeper and post my findings here.
Ok, seems the battery mode is not set properly honored when the maxsoc is reached during normal operations. But when evcc is restarted when soc is >= maxsoc, evcc will stop charging the battery.
@andig What can I do to provide more data? It seems logs are not sufficient here.
It is honored as you see in the logs.
[site ] DEBUG 2026/02/20 03:15:09 battery BYD Batterie: limit soc reached (95 > 80)
[site ] DEBUG 2026/02/20 03:15:09 set battery BYD Batterie mode: hold
What you don't see in the current logs is how the commands to change the battery mode to hold are sent and interpreted by the battery/inverter.
Which templates/device are you using? Is ensured that the device transists properly between mode grid and hold (in exactly that order)?
The idea behind using evcc meter is to verify that switching battery mode works. For this, it's necessary that you actually use the battery mode parameter to switch between modes and then watch the behavior of your battery.
https://docs.evcc.io/docs/reference/cli/evcc_meter
I've found your discussion. So you are using the Kostal template. The provided information in addition:
Please ensure to have the watchdog timeout in evcc exactly equal to the setting of the inverter. Per default 60s.
Kostal template handles the transition correct, if the settings are appropriate.