[App] huABus - Huawei Solar Modbus to MQTT (SUN2/3/5/000 → MQTT → Home Assistant + Auto Discovery)

:wrench: huABus v1.8.1 Released - Fixes HA 2025.1+ Timeout Issue

Quick bugfix release for those experiencing timeouts with Home Assistant 2025.1 and later.

What was fixed:

  • Removed Slave ID 0 from auto-detection sequence
  • Slave ID 0 is a Modbus broadcast address (write-only, no responses)
  • HA 2025.1+ enforces this more strictly, causing timeouts during auto-detection

Changes:

python

# Before: [0, 1, 2, 100]
# After:  [1, 2, 100]

Benefits:

  • :white_check_mark: No more timeout errors on HA 2025.1+
  • :white_check_mark: Faster auto-detection (one less attempt)
  • :white_check_mark: Modbus specification compliant

Update: Standard addon update via Home Assistant UI

Workaround for older versions:

text

modbus:
  auto_detect_slave_id: false
  slave_id: 2  # or 1, depending on your inverter

Thanks to @HANT for the detailed bug report! :pray:

Changelog: GitHub

[Version 1.8.1]

Hi there,
I did the update, and it was fine w/ the auto-detection turned off. But as soon as it was turned off, it still missed the right ID, so the auto-detection does not work for me (it just restarts).

For me the proven ID to work is 2 (20KTL inverter, A04 SDongle).

2026-02-15T21:20:43 INFO: >> Starting Python application...
2026-02-15 21:20:43,711 - huawei.main - INFO - 📋 Logging initialized: DEBUG
2026-02-15 21:20:43,711 - huawei.main - DEBUG - External loggers: pymodbus=INFO, huawei_solar=INFO
2026-02-15 21:20:43,711 - huawei.main - INFO - 🚀 Huawei Solar → MQTT starting
2026-02-15 21:20:43,711 - bridge.config_manager - DEBUG - Modbus:
2026-02-15 21:20:43,712 - bridge.config_manager - DEBUG -   Host: 192.168.XXX.XXX
2026-02-15 21:20:43,712 - bridge.config_manager - DEBUG -   Port: 502
2026-02-15 21:20:43,712 - bridge.config_manager - DEBUG -   Auto-detect Slave ID: True
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG - MQTT:
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG -   Host: 192.168.XXX.XXX
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG -   Port: 1883
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG -   User: XXXXXXX
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG -   Password: ***
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG -   Topic: huawei-solar
2026-02-15 21:20:43,713 - bridge.config_manager - DEBUG - Advanced:
2026-02-15 21:20:43,714 - bridge.config_manager - DEBUG -   Log Level: DEBUG
2026-02-15 21:20:43,714 - bridge.config_manager - DEBUG -   Status Timeout: 180s
2026-02-15 21:20:43,714 - bridge.config_manager - DEBUG -   Poll Interval: 25s
2026-02-15 21:20:43,714 - huawei.slave_detector - INFO - 🔍 Auto-detecting Slave ID for 192.168.178.193:502...
2026-02-15 21:20:43,714 - huawei.slave_detector - DEBUG - Trying Slave ID 1...
2026-02-15 21:20:43,819 - huawei_solar.huawei_solar - INFO - Waiting for connection
2026-02-15 21:20:45,228 - backoff - INFO - Backing off _do_read(...) for 1.0s (huawei_solar.exceptions.SlaveFailureException)
2026-02-15 21:20:46,237 - backoff - INFO - Backing off _do_read(...) for 2.0s (huawei_solar.exceptions.SlaveFailureException)
2026-02-15 21:20:48,246 - backoff - INFO - Backing off _do_read(...) for 4.0s (huawei_solar.exceptions.SlaveFailureException)
2026-02-15 21:20:48,820 - huawei.slave_detector - DEBUG - Slave ID 1 timed out
2026-02-15 21:20:48,821 - huawei.slave_detector - DEBUG - Slave ID 1 failed
2026-02-15 21:20:48,821 - huawei.slave_detector - DEBUG - Trying Slave ID 2...
2026-02-15 21:20:53,930 - huawei.slave_detector - DEBUG - Slave ID 2 error: Modbus Error: [Input/Output] Request cancelled outside library.
2026-02-15 21:20:53,931 - huawei.slave_detector - DEBUG - Slave ID 2 failed
2026-02-15 21:20:53,932 - huawei.slave_detector - DEBUG - Trying Slave ID 100...
2026-02-15 21:20:59,040 - huawei.slave_detector - DEBUG - Slave ID 100 error: Modbus Error: [Input/Output] Request cancelled outside library.
2026-02-15 21:20:59,040 - huawei.slave_detector - DEBUG - Slave ID 100 failed
2026-02-15 21:20:59,041 - huawei.slave_detector - ERROR - ❌ Auto-detection failed! Tried: [1, 2, 100]
2026-02-15 21:20:59,041 - huawei.main - ERROR - ❌ Auto-detection failed. Please set 'modbus.auto_detect_slave_id: false' and configure 'modbus.slave_id' manually in the add-on configuration.
2026-02-15 21:20:59,041 - huawei.main - ERROR - ❌ Tested Slave IDs: [1, 2, 100] on 192.168.XXX.XXX:XXX

Turning auto-detection off in the configuration, put back the food on the table though.

Thanks,
HANT

To add to this the integration wlcrs/huawei GitHub - wlcrs/huawei_solar: Home Assistant integration for Huawei Solar inverters via Modbus also suffers from the same issue, when I try the ‘auto’ feature.

At least that is true for my set up.

Thanks,
HANT

:hammer_and_wrench: huABus v1.8.2 released — CI improvements & bug fixes

Hey everyone! Small but solid maintenance release:

v1.8.2 migrates the CI pipeline from pip to uv,
which cuts build times by ~40% and ensures fully reproducible
test environments. No changes to addon functionality —
everything works exactly as before.

:arrow_right: Update via Settings → Add-ons → huABus → Update

[Version 1.8.2] That one fixed that one for me.
Auto slave ID detection works for me now.

Thanks,
HANT

@arboeh hi! Do you have an evcc setup? Is it possible to run both huABus and evcc without a Modbus proxy?

Hey @altrdev,

thanks a lot for your question – this is exactly the kind of use case I had in mind when I started developing huABus.

One of my main goals was to have a single Modbus TCP client with high code quality and extensive test coverage that talks to the Huawei inverter and exposes everything via MQTT (with HA Auto Discovery on top). This enables both Home Assistant and EVCC to consume the data without needing any Modbus proxy or fragile workarounds.

With this example, you can see how simple the EVCC side becomes: you just subscribe to the huawei-solar topic and map the JSON fields to the grid, PV and battery meters.

Requirement: Of course MQTT must be enabled in the EVCC add-on…

EVCC configuration:

# Grid Meter
power:
  source: mqtt
  topic: huawei-solar
  jq: (.meter_power_active * -1)

# Solar Meter
power:
  source: mqtt
  topic: huawei-solar
  jq: .power_input

# Battery (Optional)
power:
  source: mqtt
  topic: huawei-solar
  jq: (.battery_power * -1)
soc:
  source: mqtt
  topic: huawei-solar
  jq: .battery_soc
capacity: 10

I’ve been using this configuration for months and it simply works. No need for all the Modbus proxy fiddling and no outages whatsoever.

I added this configuration as an example in the huABus README so others can easily integrate their Huawei PV system with EVCC in the same way: GitHub - arboeh/huABus: MQTT bridge for Huawei solar inverters (SUN2000/3000/5000) → Home Assistant · GitHub

Happy monitoring and EV charging! :slight_smile: :sun_with_face:
@arboeh | GitHub - huABus

Omg, @arboeh thanks for the info! Now everything is very clear. I was just missing the evcc configuration to subscribe to an MQTT topic. Thanks again – I’m already using your huABus successfully in Home Assistant and now I’m working on the evcc side.

Does it work for you? If you have problems, feel free to ask.

I have to note that for me it works barely.
Currently, it fails all the time [Home Assistant OS Core 2026.3.3] for me.

But it is not a big issue as I know my slave ID. Having it manually setting it works fine.

HANT

Fix will come soon…

:rocket: huABus v1.8.3 is out — Auto Slave ID Detection fix

Hey everyone!

Just released v1.8.3 — a focused patch that resolves a persistent issue with the Auto Slave ID Detection (#15).

What was the problem?
When the first connection attempt to a Slave ID failed, all subsequent IDs (e.g. 2, 100) would throw a Request cancelled outside library error. The culprit: TCP teardown wasn’t finishing before the next attempt kicked off, and CancelledError was being swallowed internally instead of propagated.

What’s fixed:

  • :stopwatch: Added INTER_ATTEMPT_DELAY (2 s) between attempts — gives TCP teardown time to complete cleanly
  • :stop_button: Added a timeout to client.stop() — no more indefinite blocking on broken clients
  • :white_check_mark: CancelledError now propagates correctly up the call stack

Thanks to everyone who reported and helped reproduce #15 — really appreciated!

Update via HACS or manually as usual. Feedback and bug reports are always welcome here or as a GitHub issue. :raised_hands:

Yep, thanks it works like a charm !

v1.8.4 – Poll Interval Fix

Quick follow-up to v1.8.3: while fixing the Slave ID auto-detection issue, the improved TCP handling inadvertently revealed a pre-existing bug — the configured poll_interval was never actually used in the main loop. Previously this went unnoticed because broken TCP teardowns were accidentally throttling the loop to ~20-30s. With the cleaner connection handling in v1.8.3, the loop ran as fast as the Modbus read completed (~5-8s), ignoring the configured interval entirely.

v1.8.4 fixes this by properly waiting out the remaining poll interval after each successful cycle.

Upgrade recommended if you’re on v1.8.3.

Quick check-in: Is version 1.8.4 working for everyone?

Hi all! :wave: Just wanted to do a quick sanity check — is the latest release v1.8.4 running smoothly for everyone? Particularly curious about the Slave ID Detection — is it being picked up correctly in your setups, or are you seeing any issues there?

Feel free to share your inverter model and any relevant config details if you’re running into trouble. Thanks!

Happy monitoring! :sun_with_face: - arboeh

Hi folks,

I’m quite happy with the add-on overall and I’m currently building some helpers to get a clean PV yield without gains coming from the battery.

However, I’m experiencing an issue with the inverter cycle times (unfortunately I don’t have reference values from the time when I was using the Modbus proxy add-on before). The Wi‑Fi reception of the SDongle is excellent, and the latencies are in the single‑digit millisecond range without any drops.

Despite that, the cycle times are quite high, averaging around 75 seconds. After a restart and/or when using different firmware versions, they sometimes increase to 800 seconds or more.

Do you have any idea what could be done to fix this?

Firmware versions:

  • Inverter: V100R001C00SPC175
  • SDongle: V200R022C10SPC126

Log excerpt:

2026-04-14 21:31:21,123 - huawei.main - DEBUG - Cycle #8018
2026-04-14 21:31:21,123 - huawei.main - DEBUG - Starting cycle
2026-04-14 21:31:21,124 - huawei.main - DEBUG - Reading 67 essential registers
2026-04-14 21:32:27,911 - huawei.main - DEBUG - Skipping 'storage_unit_1_soc' (not available)
2026-04-14 21:32:27,911 - huawei.main - DEBUG - Skipping 'storage_unit_2_soc' (not available)
2026-04-14 21:32:27,911 - huawei.main - DEBUG - Skipping 'storage_unit_3_soc' (not available)
2026-04-14 21:32:27,911 - huawei.main - INFO - 📖 Essential read: 66.8s (64/67)
2026-04-14 21:32:27,911 - huawei.transform - DEBUG - Transforming 64 registers
2026-04-14 21:32:27,911 - huawei.transform - DEBUG - Transform complete: 65 values (0.000s)
2026-04-14 21:32:27,911 - huawei.mqtt - DEBUG - Publishing: Solar=403W, Grid=-1W, Battery=-396W
2026-04-14 21:32:27,912 - huawei.mqtt - DEBUG - Data published: 65 keys
2026-04-14 21:32:27,912 - huawei.main - INFO - 📊 Published - PV: 0W | AC Out: 403W | Grid: -1W | Battery: -396W
2026-04-14 21:32:27,912 - huawei.main - DEBUG - Cycle: 66.8s (Modbus: 66.8s, Transform: 0.000s, Filter: 0.000s, MQTT: 0.00s)
2026-04-14 21:32:27,912 - huawei.main - WARNING - ⚠️ Cycle 66.8s > 80% poll_interval (30s)
2026-04-14 21:32:27,912 - huawei.mqtt - DEBUG - Status: 'online' → huawei-solar/status
2026-04-14 21:32:27,912 - huawei.main - DEBUG - Heartbeat OK: 0.0s since last success
2026-04-14 21:32:27,912 - huawei.main - DEBUG - Cycle #8019
2026-04-14 21:32:27,912 - huawei.main - DEBUG - Starting cycle

Hi @WinnyPuh, elcome to the community,

I took a closer look — and I think the root cause is actually your SDongle firmware version, not the add-on itself.

We’re both running a V200-series SDongle, but different firmware versions:

  • Mine: V200R022C10SPC312
  • Yours: V200R022C10SPC126

My cycle times come in at ~6.9s for 64 registers, yours at ~66.8s — a factor of ~10x. Same hardware generation, same sequential polling logic in the code, but a completely different per-request latency. That strongly suggests Huawei significantly improved the internal Modbus TCP handling between SPC126 and SPC312.

My recommendation: update your SDongle firmware to SPC312 or newer. This can be done via the Huawei FusionSolar app or the local web interface of the SDongle.

In the meantime:

  • Increase poll_interval to 90 or 120 seconds to avoid the constant :warning: Cycle > 80% poll_interval warnings

Does anyone else with a V200 SDongle on older firmware see the same behaviour? Would be great to confirm this pattern.

Hi @arboeh,

i tested all versions available via fusionsolar Installer backend it only gets worse. Just to be shure i did an upgrade to PC312 again, this is the result:

2026-04-16 14:31:25,327 - huawei.main - INFO - :bar_chart: Published - PV: 3830W | AC Out: 3830W | Grid: 3148W | Battery: 0W

2026-04-16 14:31:25,327 - huawei.main - DEBUG - Cycle: 91.4s (Modbus: 91.4s, Transform: 0.000s, Filter: 0.000s, MQTT: 0.00s)

2026-04-16 14:31:25,327 - huawei.main - WARNING - :warning: Cycle 91.4s > 80% poll_interval (60s)

2026-04-16 14:31:25,327 - huawei.mqtt - DEBUG - Status: ‘online’ → huawei-solar/status

2026-04-16 14:31:25,327 - huawei.main - DEBUG - Heartbeat OK: 0.0s since last success

2026-04-16 14:31:25,327 - huawei.main - DEBUG - Cycle #630

2026-04-16 14:31:25,327 - huawei.main - DEBUG - Starting cycle

2026-04-16 14:31:25,328 - huawei.main - DEBUG - Reading 67 essential registers

2026-04-16 14:32:53,292 - huawei.main - DEBUG - Skipping ‘storage_unit_1_soc’ (not available)

2026-04-16 14:32:53,293 - huawei.main - DEBUG - Skipping ‘storage_unit_2_soc’ (not available)

2026-04-16 14:32:53,293 - huawei.main - DEBUG - Skipping ‘storage_unit_3_soc’ (not available)

2026-04-16 14:32:53,293 - huawei.main - INFO - :open_book: Essential read: 88.0s (64/67)

2026-04-16 14:32:53,293 - huawei.transform - DEBUG - Transforming 64 registers

2026-04-16 14:32:53,293 - huawei.transform - DEBUG - Transform complete: 65 values (0.000s)

2026-04-16 14:32:53,293 - huawei.mqtt - DEBUG - Publishing: Solar=4498W, Grid=3717W, Battery=0W

2026-04-16 14:32:53,293 - huawei.mqtt - DEBUG - Data published: 65 keys

2026-04-16 14:32:53,294 - huawei.main - INFO - :bar_chart: Published - PV: 4498W | AC Out: 4498W | Grid: 3717W | Battery: 0W

2026-04-16 14:32:53,294 - huawei.main - DEBUG - Cycle: 88.0s (Modbus: 88.0s, Transform: 0.000s, Filter: 0.000s, MQTT: 0.00s)

2026-04-16 14:32:53,294 - huawei.main - WARNING - :warning: Cycle 88.0s > 80% poll_interval (60s)

2026-04-16 14:32:53,295 - huawei.mqtt - DEBUG - Status: ‘online’ → huawei-solar/status

2026-04-16 14:32:53,295 - huawei.main - DEBUG - Heartbeat OK: 0.0s since last success

2026-04-16 14:32:53,295 - huawei.main - DEBUG - Cycle #631

2026-04-16 14:32:53,295 - huawei.main - DEBUG - Starting cycle

2026-04-16 14:32:53,295 - huawei.main - DEBUG - Reading 67 essential registers

2026-04-16 14:34:16,715 - huawei.main - DEBUG - Skipping ‘storage_unit_1_soc’ (not available)

2026-04-16 14:34:16,715 - huawei.main - DEBUG - Skipping ‘storage_unit_2_soc’ (not available)

2026-04-16 14:34:16,716 - huawei.main - DEBUG - Skipping ‘storage_unit_3_soc’ (not available)

2026-04-16 14:34:16,716 - huawei.main - INFO - :open_book: Essential read: 83.4s (64/67)

2026-04-16 14:34:16,716 - huawei.transform - DEBUG - Transforming 64 registers

2026-04-16 14:34:16,716 - huawei.transform - DEBUG - Transform complete: 65 values (0.000s)

2026-04-16 14:34:16,716 - huawei.mqtt - DEBUG - Publishing: Solar=3208W, Grid=3123W, Battery=0W

2026-04-16 14:34:16,716 - huawei.mqtt - DEBUG - Data published: 65 keys

2026-04-16 14:34:16,716 - huawei.main - INFO - :bar_chart: Published - PV: 3208W | AC Out: 3208W | Grid: 3123W | Battery: 0W

2026-04-16 14:34:16,716 - huawei.main - DEBUG - Cycle: 83.4s (Modbus: 83.4s, Transform: 0.000s, Filter: 0.000s, MQTT: 0.00s)

2026-04-16 14:34:16,716 - huawei.main - WARNING - :warning: Cycle 83.4s > 80% poll_interval (60s)

2026-04-16 14:34:16,717 - huawei.mqtt - DEBUG - Status: ‘online’ → huawei-solar/status

2026-04-16 14:34:16,717 - huawei.main - DEBUG - Heartbeat OK: 0.0s since last success

2026-04-16 14:34:16,717 - huawei.main - DEBUG - Cycle #632

2026-04-16 14:34:16,717 - huawei.main - DEBUG - Starting cycle

2026-04-16 14:34:16,717 - huawei.main - DEBUG - Reading 67 essential registers

At this point I’m not sure what else could be the cause. As mentioned earlier, the connection quality is good, and I also fully reset the inverter itself, but that did not improve the behavior either.

Has anyone experienced similar issues or found a solution for this?

That’s really strange. I promise I’ll take a closer look at it in the next few days.
This is a really stupid question, and please don’t hit me for it: You only have one Modbus connection active, right?

no worries, valid question – I previously used the Modbus proxy add-on because I was also directly querying data from my wallbox. However, that proxy is now disabled, and there is no other client accessing the SDongle.