Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: EMMA going unavailable every 2 minutes #969

Closed
5 tasks done
XalaTheShepard opened this issue Mar 12, 2025 · 1 comment
Closed
5 tasks done

[Bug]: EMMA going unavailable every 2 minutes #969

XalaTheShepard opened this issue Mar 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@XalaTheShepard
Copy link

Describe the issue

Dear all,

Every 2 minutes my EMMA power meter loses connection to HA, turning the EMMA and inverter unavailable.
The EMMA is wired connected via Modbus to HA.

Please find below the necessary information.

Please do not hesitate to contact me if there are further questions.

Kind regards,

Robin

Describe your Huawei Solar Setup

Inverter Type: SUN2000
Inverter Firmware version: V100R001C00SPC162
sDongle present: No
Power meter present: three phase
Optimizers Present: Yes
Battery: LUNA2000-S1 xxkWh (Released 2024)
Battery Firmware version:
Huawei Solar integration version: 1.5.4

How do you connect to the inverter?

Via the SUN2000-<serial_no> WiFi

Upload your Diagnostics File

config_entry-huawei_solar-01JM9ZN96Z0G07EGV1Z8SJD8R5.json

Upload your relevant debug logs

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py:146
First occurred: March 11, 2025 at 9:14:07 PM (4434 occurrences)
Last logged: 12:33:54 AM

Timeout while waiting for connection. Reconnecting
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 141, in _communication_lock
    await asyncio.wait_for(
    ...<2 lines>...
    )
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@XalaTheShepard XalaTheShepard added the bug Something isn't working label Mar 12, 2025
@wlcrs
Copy link
Owner

wlcrs commented Mar 13, 2025

This issue seems to be caused by a connection failure or an unstable connection to the inverter. This integration already has already implemented a lot of logic to automatically recover from connection failures or unstable connections. The three most important ones are:

  • automatic reconnects if the connection to the inverter failed;
  • each Modbus request is retried for up to 6 times, with increasing waits between each attempt to allow the connection to recover;
  • after 3 failed Modbus requests the connection is reset to fix hanging connections.

Please understand that I cannot help you solve your connection failure or unstable connection. Consider an alternative connection method.
If you are convinced that there is no connectivity issue, then I invite you to debug and fix the problem yourself and submit a pull request to the underlying huawei-solar Python library. Your input would be greatly appreciated.

As there is nothing actionable for me to do in this issue, I'm closing it. You are welcome to open a topic in Discussions: Connecting to the inverter to get community support for your problem.

@wlcrs wlcrs closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants