Describe the bug
With batteryDischargeControl enabled, evcc correctly puts the home battery into hold mode when smart-cost (or plan/fast) charging starts — but the hold is written to the device once and never refreshed. On a Fronius GEN24 the SunSpec model 124 revert timer (InOutWRte_RvrtTms, register 40358) is 3600 s, so the inverter silently reverts to normal self-consumption exactly 60 minutes after evcc's single write. evcc's internal state still says "hold", so it never re-writes, and the home battery then discharges at full power into the vehicle charge for the rest of the session.
Any battery hold longer than 60 minutes is affected; shorter charges appear to work, which makes this easy to misdiagnose.
Observed behaviour (telemetry, 30 s resolution, times UTC)
Vehicle smart-cost charging at ~11 kW, home battery at 48%:
| Time |
Event |
| 21:00:41 |
Charging starts; one sample of ~7.7 kW battery discharge |
| 21:01:11 |
Hold applied — battery power drops to ~1 W, SoC steady at 48% |
| 22:00:41 → 22:01:11 |
Exactly 3600 s after the hold write: battery jumps to ~7.7 kW discharge (its maximum), grid import drops ~11.7 → ~4.2 kW, charging continues at ~11 kW |
| 23:13 |
Vehicle reaches its 80% limit, charging stops; battery has drained 48% → ~23% |
Smart-cost remained active the whole session (all hours ≤ the 0.12 limit), the loadpoint kept fast-charging, and there is no battery mode change or error in the logs — the release happens inside the inverter, not in evcc.
Root cause
core/site_battery.go → requiredBatteryMode(): keepUnlessModified returns api.BatteryUnknown while the current mode already equals the required mode, so applyBatteryMode is skipped on every subsequent cycle. On current master this is reinforced in applyBatteryMode by the site.batteryModeApplied cache ("don't re-apply the mode the battery is already in").
- The
fronius-gen24 template's batterymode hold case writes StorCtl_Mod=2, OutWRte=0 and does not touch InOutWRte_RvrtTms.
- The GEN24 (tested: Symo GEN24 Plus 8.0, FW 1.39.5-1) has
InOutWRte_RvrtTms = 3600, so the storage-control settings expire after 60 minutes without a refreshing write. Per SunSpec model 124 this revert-timeout behaviour is standard, so other SunSpec storage devices are likely affected too.
Expected behaviour
The hold should persist for the whole charging session. Possible fixes:
Version
0.313.3 (behaviour verified unchanged in core/site_battery.go on current master)
Configuration
meters:
- name: battery
type: template
template: fronius-gen24
usage: battery
host: <inverter>
port: 502
id: 200
site:
meters:
grid: grid
pv: pv
battery: battery
loadpoints:
- charger: wallbox # ocpp template
vehicle: bmw_ix # cardata template
mode: pv
batteryDischargeControl: true and smartCostLimit: 0.12 set via UI.
Log details
Log level INFO — the session only shows (times local, UTC+3):
[lp-1 ] INFO 2026/08/21 00:00:41 start charging ->
[lp-1 ] INFO 2026/08/21 02:13:11 stop charging <-
No battery mode: errors, no planner warnings during the session. The hold engage/release timing above is from the site's InfluxDB export (batteryPower, batterySoc, gridPower, chargePower).
Describe the bug
With
batteryDischargeControlenabled, evcc correctly puts the home battery into hold mode when smart-cost (or plan/fast) charging starts — but the hold is written to the device once and never refreshed. On a Fronius GEN24 the SunSpec model 124 revert timer (InOutWRte_RvrtTms, register 40358) is 3600 s, so the inverter silently reverts to normal self-consumption exactly 60 minutes after evcc's single write. evcc's internal state still says "hold", so it never re-writes, and the home battery then discharges at full power into the vehicle charge for the rest of the session.Any battery hold longer than 60 minutes is affected; shorter charges appear to work, which makes this easy to misdiagnose.
Observed behaviour (telemetry, 30 s resolution, times UTC)
Vehicle smart-cost charging at ~11 kW, home battery at 48%:
Smart-cost remained active the whole session (all hours ≤ the 0.12 limit), the loadpoint kept fast-charging, and there is no
battery modechange or error in the logs — the release happens inside the inverter, not in evcc.Root cause
core/site_battery.go→requiredBatteryMode():keepUnlessModifiedreturnsapi.BatteryUnknownwhile the current mode already equals the required mode, soapplyBatteryModeis skipped on every subsequent cycle. On current master this is reinforced inapplyBatteryModeby thesite.batteryModeAppliedcache ("don't re-apply the mode the battery is already in").fronius-gen24template'sbatterymodehold case writesStorCtl_Mod=2,OutWRte=0and does not touchInOutWRte_RvrtTms.InOutWRte_RvrtTms = 3600, so the storage-control settings expire after 60 minutes without a refreshing write. Per SunSpec model 124 this revert-timeout behaviour is standard, so other SunSpec storage devices are likely affected too.Expected behaviour
The hold should persist for the whole charging session. Possible fixes:
InOutWRte_RvrtTmswhen engaging/releasing a mode (with the trade-off that a crashed evcc would leave the battery locked if the timer is disabled).Version
0.313.3(behaviour verified unchanged incore/site_battery.goon current master)Configuration
batteryDischargeControl: trueandsmartCostLimit: 0.12set via UI.Log details
Log level INFO — the session only shows (times local, UTC+3):
No
battery mode:errors, no planner warnings during the session. The hold engage/release timing above is from the site's InfluxDB export (batteryPower,batterySoc,gridPower,chargePower).