Load management: circuit allowance ignores battery charge power, permanently preventing charge start
Describe the bug
When a circuit uses the grid meter to limit grid import, its available allowance is computed from the raw meter reading. In an installation with a hybrid inverter, the home battery absorbs PV surplus before it reaches the meter, so the circuit sees no headroom even while several kW of surplus exist. If the resulting allowance falls below the loadpoint's minimum charge power, charging can never start — in any mode, including now.
The two evaluations disagree within the same control cycle:
Surplus control: sitePower = gridPower + batteryPower + residualPower → -9637 W available, enable threshold passed, requests 14 A Circuit: allowed = maxPower - (circuitPower - loadpointOldPower) → 3803 W allowed, below the 4140 W the loadpoint needs Charging is refused, short by 337 W, while 6489 W flows into the battery in that same cycle. The battery charge power is known to evcc and used by surplus control, but does not reach the circuit calculation.
Two aspects make this hard to diagnose:
A running loadpoint is unaffected, because its own power is subtracted out (loadpointOldPower). Only starting is blocked. The failure therefore looks intermittent — it depends on whether the battery happens to be full. Nothing is logged. After pv enable timer elapsed the loadpoint simply stays idle. The only trace is the validate power line, and the reader must know the loadpoint's minimum charge power to see that the cap sits below it.
I can provide further infos or logs if necessary.
Steps to reproduce
- Configure a circuit whose meter is the grid meter, with maxPower set below the loadpoint's minimum charge power (here: maxPower: 500, 3-phase loadpoint without phase switching, minimum 6 A ≈ 4140 W).
- Assign a loadpoint to that circuit and set it to pv mode.
- Wait for a situation with clear PV surplus while the home battery is charging — i.e. the inverter is absorbing surplus, so grid export is far smaller than actual surplus.
- Connect a vehicle.
- Observe: the enable threshold is passed and the pv timer elapses, but charging never starts. Switching to now does not help either.
Configuration details
/app # evcc config
[main ] INFO 2026/08/26 09:37:31 using config file: /etc/evcc.yaml
[main ] INFO 2026/08/26 09:37:31 using sqlite database: /root/.evcc/evcc.db?_pragma=busy_timeout(5000)&_pragma=foreign_keys(1)&_pragma=auto_vacuum(INCREMENTAL)
charger
---
db:8 {Type:sgready Disable:false Title: Icon: Product:} map[yaml:## required attributes [type: sgready]
setmode: # set operation mode (1: reduced, 2: normal, 3 boost)
source: mqtt
topic: homeassistant/export/heatingmode #
## optional attributes (read-only)
#getmode: # operation mode (1: reduced, 2: normal, 3 boost)
# source: const
# value: 2
power: # charge power in W
source: mqtt
topic: homeassistant/export/panasonic_heat_pump_consumption
energy: # meter reading in kWh
source: mqtt
topic: homeassistant/export/aquarea_pump_total_consumption_total
temp: # current temperature (°C)
source: mqtt
topic: homeassistant/export/coe_analog_can57_4
limittemp: # temperature limit (°C) configured in device
source: const
value: 22
## optional attributes (writeable)
#setmaxpower: # update the maximum charging power
# source: js
# script: console.log(maxpower);
]
meter
---
db:1 {Type:template Disable:false Title:Goodwe-Speicher Icon: Product:GoodWe ET/EH/BH/BT Hybrid Inverter} map[battery:1 baudrate:9600 capacity:20 comset:8N1 host:192.168.169.16 id:247 maxacpower:0 maxchargepower:6500 maxdischargepower:6500 maxsoc:100 minsoc:11 modbus:tcpip port:502 template:goodwe-hybrid usage:battery]
db:3 {Type:template Disable:false Title:GoodWe PV Icon: Product:GoodWe ET/EH/BH/BT Hybrid Inverter} map[battery:1 baudrate:9600 comset:8N1 host:192.168.169.16 id:247 maxacpower:6500 maxchargepower:10000 maxdischargepower:10000 maxsoc:100 minsoc:10 modbus:tcpip port:502 template:goodwe-hybrid usage:pv]
db:6 {Type:template Disable:false Title:Huawei PV Icon: Product:Home Assistant} map[maxacpower:0 power:sensor.inverter_active_power template:homeassistant uri:***** usage:pv]
db:10 {Type:template Disable:false Title: Icon: Product:HomeWizard Wi-Fi P1 Meter} map[host:192.168.169.229 template:homewizard usage:grid]
vehicle
---
db:4 {Type:template Disable:false Title: Icon: Product:Generisches Fahrzeug (ohne API)} map[capacity:38 coarsecurrent:true icon:car maxCurrent:32 minCurrent:6 phases:1 priority:9 template:offline title:Emilia]
db:18 {Type:template Disable:false Title: Icon: Product:TeslaMate} map[autodetectdisabled:false capacity:62 climaterdisabled:false icon:car id:1 priority:8 template:teslamate timeout:720h title:Toni wakeupdisabled:false]
tariff
---
db:11 {Type:template Disable:false Title: Icon: Product:Zeitabhängiger Tarif} map[price:0.19 template:fixed-zones zones:[map[days: hours:10:00-16:00 months:apr,may,jun,jul,aug,sep price:0.17] map[days: hours:22:00-23:59 months:jan,feb,mar,oct,nov,dec price:0.17] map[days: hours:00:00-04:00 months:jan,feb,mar,oct,nov,dec price:0.17]]]
db:12 {Type:template Disable:false Title: Icon: Product:Zeitabhängiger Tarif} map[price:0.09 template:fixed-zones zones:[map[days: hours:11:00-16:00 months: price:0.05]]]
db:13 {Type:template Disable:false Title: Icon: Product:Electricity Maps Free API} map[template:electricitymaps-free token:***** zone:AT]
db:14 {Type:template Disable:false Title: Icon: Product:Open-Meteo Temperature} map[interval:1h lat:***** lon:***** template:open-meteo-temperature]
db:15 {Type:template Disable:false Title:Südseite Icon: Product:Forecast.Solar} map[az:10 dec:30 interval:1h kwp:16.125 lat:***** lon:***** template:forecast-solar]
db:16 {Type:template Disable:false Title:Ostseite Icon: Product:Forecast.Solar} map[az:-80 dec:30 interval:1h kwp:4.3 lat:***** lon:***** template:forecast-solar]
db:17 {Type:template Disable:false Title:Westseite Icon: Product:Forecast.Solar} map[az:100 dec:30 interval:1h kwp:3.01 lat:***** lon:***** template:forecast-solar]
loadpoint
---
db:9 {Type: Disable:false Title: Icon: Product:} map[charger:db:8 circuit:main defaultMode:pv limitSoc:100 meter: mode:off phasesConfigured:1 planStrategy:map[continuous:false precondition:0] priority:10 soc:map[estimate:true poll:map[interval:3.6e+12 mode:charging]] thresholds:map[disable:map[delay:1.8e+11 threshold:300] enable:map[delay:3e+11 threshold:-1500]] title:Wärmepumpe ui:map[maxTemp:0 minTemp:0] vehicle:]
Log details
evcc 0.314.3. Circuit main with maxPower: 500, meter = grid meter. Loadpoint 3 is fixed 3-phase (charger: phases ✗), minimum 6 A ≈ 4140 W. Battery prioritySoc: 15, battery SoC 25 % — so battery power is released to surplus control as expected.
Charge start refused:
[site ] DEBUG battery 1 power: -6489W
[site ] DEBUG pv power: 10759W
[site ] DEBUG grid power: -3298W
[site ] DEBUG site power: -9637W
[lp-3 ] DEBUG pv charge current: 14A = 0A + 14A (-9637W @ 3p)
[lp-3 ] DEBUG site power -9637W <= 0W enable threshold
[lp-3 ] DEBUG pv enable timer elapsed
[main ] DEBUG validate power: -3298W + (5W -> 4140W) > 500W capped at 3803W
500 - (-3298 - 5) = 3803 W allowed vs. 4140 W required. Note there is 3.3 kW of real export here — the surplus is not entirely invisible. The battery hides just enough of it to fall under the three-phase minimum. Without the battery absorbing 6489 W, export would have been ~9.8 kW and the allowance ~10.3 kW.
Fast mode is blocked identically:
[lp-3 ] DEBUG set charge mode: now
[main ] DEBUG validate power: -3308W + (5W -> 11040W) > 500W capped at 3813W
The loadpoint remains at status B with charge power: 5W indefinitely.
The allocation formula is confirmed by a second sample from an earlier run with maxPower: 1000:
[main] validate power: -503W + (8623W -> 11040W) > 1000W capped at 10126W # 1000 - (-503 - 8623)
[main] validate power: 1230W + (0W -> 0W) > 1000W capped at 0W # 1000 - (1230 - 0)
The asymmetry is visible directly: a running loadpoint is granted 10 kW, a stopped one 0 W, in the same installation.
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
v0.314.3
Investigated the code path and can confirm the mechanism described.
Root cause
core/circuit/circuit.go computes a circuit's available headroom purely from the configured meter's raw CurrentPower() reading (updateMeters(), circuit.go:283-316), and ValidatePower() (circuit.go:369-388) caps the requested power as maxPower - c.power. When the circuit's meter is the grid meter, c.power is the raw grid import/export value only.
Surplus control, on the other hand, computes sitePower as gridPower + batteryPower + excessDCPower + residualPower - auxPower - flexiblePower (core/site.go:1169), which does include battery charge power. In a hybrid-inverter setup where the battery is absorbing PV surplus, this makes surplus control see plenty of headroom (site power: -9637W) while the circuit's raw-grid-meter-based check sees far less (500 - (-3298) ≈ 3803W), because the battery charge power never enters the circuit's calculation.
Since a stopped loadpoint's old power is 0, the cap can land below the loadpoint's minimum charge power, so ValidatePower never allows the loadpoint to start — matching the reported "stuck at status B" behaviour and its asymmetry versus already-running loadpoints (which have old already non-zero and get their own power subtracted out).
This is not a regression from a recent change — the circuit meter/ValidatePower design has been effectively unchanged; the mismatch is an inherent gap between the two independent power calculations (circuit vs. surplus control) rather than a specific faulty commit.
Assessment
This looks like a genuine defect in how circuit power availability is computed when the circuit is tied to the grid meter in a system with a home battery, but fixing it properly requires a design decision (e.g. whether/how the circuit meter's power should be corrected for battery charge power, or whether circuits backed by the grid meter should account for battery flow at all) rather than a small isolated patch, so I'm not opening a PR for it.
🤖 Generated with Claude Code
Thanks for the detailed analysis. The mechanism is confirmed, but I don't think it's a defect in the circuit logic.
A circuit with the grid meter attached limits what the grid connection point actually sees. That is its purpose: protecting a fuse or contracted power at the connection point. For that, the raw grid meter reading is the correct input. Whether the hybrid inverter would throttle battery charging when the house load rises is inverter behaviour that evcc cannot rely on (forced charge modes, external control, etc.). If the battery does not yield, starting the loadpoint really would push the grid to +842 W import, above your 500 W limit. Surplus control on the other hand deliberately models the battery as flexible via prioritySoc/bufferSoc; the circuit has no such model and should not assume one.
The actual misconfiguration is maxPower: 500 on a grid-meter circuit while the loadpoint needs ≥4140 W. That uses load management as a "never import from grid" policy, which is what pv mode already does. With this config, now mode being blocked is by design, and start being blocked whenever the battery happens to absorb the surplus is expected. Set maxPower to the real limit of the grid connection and let pv mode handle surplus.
What is legitimately missing is a log line when the circuit cap lands below the loadpoint's minimum current. #33671 adds that.
I'm wondering if battery charge (in normal mode only!) should be counted as available to the circuit. Surplus control can model the battery as flexible via prioritySoc/bufferSoc because a wrong guess only costs some grid import. A wrong guess in load management can trip a fuse. We wouldn't notice for example if a battery self-charges for maintenance reasons.
/cc @mfuchs1984 @webalexeu wdyt?
@andig sorry saw this too late. But tldr of what I wrote in my PR. When Optimizer says the battery and the car het to charge at the same time. The car looses it on the load management. Because the charging battery is faster ramping up then the car is. And therefore in the load managements eye's it stops the charging of the acts to prevent the fuse from blowing. Even though the battery would just start limiting it's charging speed.
15. I'm wondering if battery charge (in normal mode only!) should be counted as available to the circuit. Surplus control can model the battery as flexible via prioritySoc/bufferSoc because a wrong guess only costs some grid import. A wrong guess in load management can trip a fuse. We wouldn't notice for example if a battery self-charges for maintenance reasons. /cc @mfuchs1984 @webalexeu wdyt?
In my opinion it should be considered always the worst case. In loadmanagement really essential. Also to consider that there are AC batteries (like Marstek and others) which are 1 phase and don't necessarily be on the same phase as the solar system...
20. > 15. I'm wondering if battery charge (in normal mode only!) should be counted as available to the circuit. Surplus control can model the battery as flexible via prioritySoc/bufferSoc because a wrong guess only costs some grid import. A wrong guess in load management can trip a fuse. We wouldn't notice for example if a battery self-charges for maintenance reasons. > /cc @mfuchs1984 @webalexeu wdyt?
In my opinion it should be considered always the worst case. In loadmanagement really essential. Also to consider that there are AC batteries (like Marstek and others) which are 1 phase and don't necessarily be on the same phase as the solar system...
I think it should be optional. My Battery Control is way faster in adjusting itself then EVCC or the others. In my case EVCC currently stops charging the car when it wants to charge the battery and car at the same time.
In my opinion it should be considered always the worst case. In load management really essential.
Fully agree. But there are two levels here: load management must match exactly. Optimizer may make an opportunistic assumption.