# HBC v4.15.1 — Battery Telemetry Stalls During Active Modbus Writes
HBC v4.15.1 — battery telemetry stalls while HBC is writing (Modbus read starvation) Version: HBC v4.15.1 (clean install, 2026-09-09) Setup: 2× Marstek Venus 5.12 kWh, ESPHome Modbus over RS485 Home Assistant: 2026.9.1 · Node-RED: 5.0.6 · add-on: 22.0.5 Strategy: Self-consumption · Control mode: Full control
Summary While HBC is in Full control and actively writing, the battery power sensors stop updating for up to 74 seconds — even across a ~2 kW real change. With HBC set to Marstek control (no HBC writes), the exact same sensors update reliably every 15 seconds.
The PID therefore runs blind to its own effect, the integrator winds up, and HBC keeps commanding harder — which increases write traffic and makes the problem worse.
This looks like read starvation on the shared RS485 bus rather than a sensor or ESPHome configuration issue.
Measurement A — HBC in Full control (writing) Command entity: number.venus_...forcible_charge_power Measurement: sensor.venus..._battery_power Grid reference: sensor.p1_meter_power
Time Command (age) battery_power (age) P1 41:23 2215 (66 s) −2537 (62 s) −1715 41:27 211 (0 s) ← new command −2537 (66 s) −1686 41:31 211 (4 s) −2537 (70 s) +243 41:35 211 (8 s) −2537 (74 s) +243
At 41:27 HBC commanded a step from 2215 W to 211 W. The grid meter registered the effect within 4 seconds — a swing of roughly 1.9 kW, from export to import. The battery power sensor did not update at all for at least 74 seconds and still reported −2537 W.
PID output at that moment: −3894, while the grid had already flipped to +243 W import. The integrator had wound up completely during the blind period.
Measurement B — Marstek control (HBC not writing) select.venus_..._rs485_control_mode = disable, so no HBC writes on the bus. Same sensors, same hardware, ~40 seconds later.
Time M1 (age) M2 (age) 42:50 −205 (14 s) −492 (11 s) 42:54 −227 (3 s) −449 (0 s) 42:59 −227 (8 s) −449 (5 s) 43:04 −227 (13 s) −449 (10 s) 43:09 −177 (3 s) −449 (15 s) 43:14 −177 (8 s) −427 (5 s) 43:19 −177 (13 s) −427 (10 s) 43:23 −204 (2 s) −427 (14 s) 43:27 −204 (6 s) −436 (3 s)
Both batteries refresh on a clean 15-second cadence with no outliers. Changes of 22–50 W pass through without delay.
ESPHome configuration (unchanged in both measurements) Modbus controller: update_interval: 5s
- name: "Marstek Battery Power"
platform: modbus_controller
register_type: holding
address: 32102
value_type: S_DWORD
skip_updates: 2
filters:
- delta: 10
skip_updates: 2 on a 5 s poll gives the observed 15 s cadence in measurement B, which matches exactly. delta: 10 cannot explain measurement A, where the real change was roughly 2 kW.
Why this matters The control loop is:
read grid power — fast, seconds compute PID — 5–10 s write battery command — fast, confirmed by the grid response within 4 s read back what the battery actually did — blocked while writing Step 4 is where it breaks. The battery hardware responds correctly and quickly; only the feedback path is unavailable. With a PID this means:
the error appears not to shrink, so the integrator keeps growing HBC commands progressively harder (observed: discharge rising to 2168 W while the house was already exporting 1424 W) more writes are issued, further crowding out reads Question v4.15.1 added the write limiter and serial per-battery writes to prevent overlapping control cycles, which resolved the Already running errors. Does the limiter account for the shared read cycle on the same Modbus bus, or only for write-to-write overlap?
If reads and writes contend, a small gap between a completed write and the next read — or backing off writes when telemetry is older than the poll interval — might be enough.
What was ruled out Not a slow sensor. Measurement B shows 15 s cadence on the same entities. Not the delta filter. A 2 kW change is far above the 10 W threshold. Not a missing fast alternative. battery_voltage_average × battery_current_average matches battery_power exactly (553 = 553, 430 = 430, same sign) but updates in lockstep with it — same poll group, same latency. Not wiring or network. WiFi is −42 dBm, all diagnostic sensors refresh normally. Not a stale HA entity registry. Clean install, entities created fresh today. Environment note This installation uses an unmodified 01 start-flow.json. The site-specific P1 alias lives in house_battery_control_config.yaml as a template sensor (sensor.p1_meter_power → sensor.p1_meter_vermogen), so the upstream flow does not need patching.
You state 'The PID therefore runs blind to its own effect, the integrator winds up, and HBC keeps commanding harder' but the PID controller doesn't look at the actual battery power, it looks at the actual P1 values for controlling so it is not blind.
@wauswaus fair point, and I should have been more precise. You're right that the main self-consumption loop controls on P1, not battery_power — measurement A itself shows P1 updating within 4 seconds, so the primary loop wasn't blind. I'll drop the "PID runs blind" framing.
What the stale telemetry does still affect, as far as I can tell:
Multi-battery distribution/rotation — on a 2-battery setup (M1/M2 here), any logic that allocates charge/discharge between batteries by remaining capacity or load share needs current per-battery battery_power/SOC. If that's 74 seconds stale during exactly the period HBC is writing hardest, the split between batteries could be based on outdated numbers at the moments it matters most. Cutoff/safety thresholds — if battery_power (or SOC derived from it) feeds any cutoff/limit check, that check is running on data up to 74 s old during active control, not on the P1 signal. Dashboard/monitoring accuracy — separate from control correctness, the tiles and any logged history show wrong per-battery numbers for the exact window HBC is most active, which is misleading when diagnosing behaviour after the fact.
So the read-starvation finding (measurement A vs B) stands either way — happy to re-test any of the three points above if that's useful, or narrow the issue purely to "battery_power telemetry stalls under active Modbus writes" without the PID-blindness claim, if that's a cleaner scope for you.