My Huawei SDongle accepts exactly one Modbus connection at a time — but Home Assistant, my AC·THOR and evcc all want to read the inverter at once. Polling it from three clients just gave me dropped connections and gaps in my data. So I wrote a small asyncio cache server (~300 lines) that does one quiet poll of the SUN2000 and serves every client from that cached snapshot. Here's how it works, and the full code.
The fault that finally pushed me into writing my own Modbus server wasn't dramatic. It was a hole. Every evening, right around the time the boiler heater kicked in, my energy dashboard in Home Assistant would flatline for a few minutes and then snap back. Not a crash — just a gap, the kind you stop noticing until you're squinting at a graph trying to work out where 0.4 kWh went.
One connection, and everyone wants it
I run a Huawei SUN2000-8KTL-M1 with a LUNA2000 battery. The inverter talks to the outside world through a little SDongle, and the SDongle speaks Modbus TCP on port 502. The catch — and it's one a lot of Huawei owners walk straight into — is that the SDongle accepts exactly one Modbus TCP connection at a time.
And I had four things that wanted it: Home Assistant's Huawei Solar integration for the dashboard, the AC·THOR 9s that dumps PV surplus into the hot-water boiler and needs a live meter reading to modulate, evcc for the wallbox, and the FusionSolar cloud. FusionSolar is the lucky one — it rides its own channel up to Huawei's servers and never touches Modbus. The other three were elbowing each other off the single slot. Whoever connected last won; the rest got connection resets, and the dashboard got that flatline.






