Loading...

Modbus5

A Robust Modbus Proxy: Reconnect, Stale-Cache Detection and Timeouts Done Right

A Robust Modbus Proxy: Reconnect, Stale-Cache Detection and Timeouts Done Right

A failure-mode playbook for a self-built Modbus cache proxy in Home Assistant: reconnect with backoff, stale-cache detection that HA can alert on, per-batch and client timeouts, and 50 ms spacing for a slow SDongle — so the proxy never silently serves zeros after a nightly drop or firmware reboot.

Modbus Write-Through: Control Battery & Inverter Through a Caching Proxy in Home Assistant

Modbus Write-Through: Control Battery & Inverter Through a Caching Proxy in Home Assistant

A caching Modbus proxy only solves reads. Here is the write-through path: pass FC6 register writes straight to the inverter on a short-lived connection, echo the response, return proper Modbus exceptions — so you can force-charge the battery or set power limits over a single shared connection.

Read the Huawei SUN2000 in Home Assistant Without a Custom Integration: Native Modbus YAML

Read the Huawei SUN2000 in Home Assistant Without a Custom Integration: Native Modbus YAML

Read every Huawei SUN2000 register straight into Home Assistant with the built-in modbus platform — no custom component that breaks on upgrade. A complete register-to-YAML map with the right data_type, scale, device_class and state_class for the Energy Dashboard.

Build Your Own Modbus-TCP Cache Proxy in Python: One Inverter, Many Home Assistant Clients

Build Your Own Modbus-TCP Cache Proxy in Python: One Inverter, Many Home Assistant Clients

The Huawei SUN2000 SDongle accepts only one Modbus-TCP connection. Instead of an add-on, I wrote a ~300-line asyncio caching proxy that polls the dongle once every 10s and serves the registers to Home Assistant, AC·THOR and evcc at the same time. Full MBAP parsing, register batching and an in-memory cache.

Caching a Huawei SUN2000 over Modbus for Home Assistant

Caching a Huawei SUN2000 over Modbus for Home Assistant

My Huawei SDongle accepts exactly one Modbus connection — but Home Assistant, the AC·THOR and evcc all want the inverter's data. Here's the ~300-line asyncio cache server I wrote to feed all of them from a single quiet poll.