huawei_solar icon indicating copy to clipboard operation
huawei_solar copied to clipboard

[Bug]: huawei_solar v 1.3.4b1 integration is not loaded

Open Almetu opened this issue 10 months ago • 3 comments

Describe the issue

Just after update/installation the integration loaded and works normally, but after some time or HA restart it’s not loaded.

Home Assistant Core 2024.3.3 Supervisor 2024.03.1 Operating System 12.1 Frontend 20240307.0

Bescribe your Huawei Solar Setup

Inverter Type: SUN2000-6KTL-M1 Inverter Firmware version: the latest SDongle present: yes Power meter present: three phase / yes Battery: LG RESU xxkWh / LUNA2000 xxkWh / None Battery Firmware version:

How do you connect to the inverter?

Via the SUN2000-<serial_no> WiFi

Upload your Diagnostics File

2024-03-29 13:07:21.566 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-03-29 13:07:51.739 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message' File "/config/custom_components/huawei_solar/init.py", line 17, in from huawei_solar import HuaweiSolarBridge, HuaweiSolarException, InvalidCredentials, register_values as rv File "/usr/local/lib/python3.12/site-packages/huawei_solar/init.py", line 7, in File "/usr/local/lib/python3.12/site-packages/huawei_solar/bridge.py", line 17, in from .huawei_solar import DEFAULT_BAUDRATE, DEFAULT_SLAVE, DEFAULT_TCP_PORT, AsyncHuaweiSolar, Result File "/usr/local/lib/python3.12/site-packages/huawei_solar/huawei_solar.py", line 18, in

Upload your relevant debug logs

2024-03-29 13:07:21.566 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-29 13:07:51.739 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'huawei_solar': Unable to import component: No module named 'pymodbus.message'
File "/config/custom_components/huawei_solar/__init__.py", line 17, in <module>
from huawei_solar import HuaweiSolarBridge, HuaweiSolarException, InvalidCredentials, register_values as rv
File "/usr/local/lib/python3.12/site-packages/huawei_solar/__init__.py", line 7, in <module>
File "/usr/local/lib/python3.12/site-packages/huawei_solar/bridge.py", line 17, in <module>
from .huawei_solar import DEFAULT_BAUDRATE, DEFAULT_SLAVE, DEFAULT_TCP_PORT, AsyncHuaweiSolar, Result
File "/usr/local/lib/python3.12/site-packages/huawei_solar/huawei_solar.py", line 18, in <module>

Please confirm the following:

  • [X] I'm running the latest release of Home Assistant.
  • [X] I'm running the latest release of this integration.
  • [X] I did not find an existing issue describing this problem.
  • [X] I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • [X] I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)

Almetu avatar Mar 29 '24 15:03 Almetu

Same problem with me. I updated and after the restart I lost all the sensors. I deleted the integration and added it again but nothing happens, it connects to the inverter but no longer displays any sensors.

bufferzone2 avatar Apr 01 '24 16:04 bufferzone2

Another pymodbus version is installed than what the integration supports. This happens when two or more integrations use that same dependency, but require different versions. v1.3.4b1 requires pyModbus v3.6.6

You will need to make sure that all modbus-dependent integrations support the same pymodbus version. Welcome in this special place of hell called the "Python dependency hell".

wlcrs avatar Apr 01 '24 19:04 wlcrs

Any idea how to fix this? How can I check the versions in use? Is there a way making sure pymodbus is updated to 3.6.6?

RonnyStraetling avatar Apr 03 '24 07:04 RonnyStraetling

Hi, I think I have the same problem. This morning all worked well but than i lost all sensors. "Einrichtung fehlgeschlagen". I updated to the actual beta version but it didn't help. Is there a solution?

Harald1387 avatar Apr 18 '24 11:04 Harald1387

Same here, I only get errors since a few days again... Seems to be happening every time there was an update to something I believe. I'll try to do the remove / reinstall dance to see if that helps fix the problem again.

sLesage avatar Apr 22 '24 06:04 sLesage

I have the same problem. Have tried to remove and reinstall, going all the way to removing it totally (via HACS) and doing a fresh download. It now gets stuck on "Please wait, starting configuration wizard for Huawei Solar" which eventually times out with a "config flow" error. The version is the latest alpha.

themaninspain avatar Apr 24 '24 15:04 themaninspain

+1 same here

faithless11 avatar May 01 '24 04:05 faithless11

Same problem here …

dkrebs avatar May 01 '24 11:05 dkrebs

I finally solved it by deleting the integration, removing it from HACS and reinstalling (v1.3.3) from scratch. The integration now works with no problems.

themaninspain avatar May 01 '24 12:05 themaninspain

Just updated to HA Core 2024.5.0 and the problem is back! Now recovering to a backup of 2024.4.4 (which was working). After reverting to 2024.4.4 the integration no longer loads, am trying to reinstall but I have a repeat of the config wizard problems and what I did before no longer works. I get this error message when configuring: "Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble" After 24 hours of deleting, reinstalling, restarting and rebooting I finally go it to work again. Now I don't want to even try to upgrade HA Core to 2024.5.0

themaninspain avatar May 02 '24 13:05 themaninspain

Did someone find a solution for that problem? I have installed all HA updates since the problem appeared. The behavior is still the same. The integration works for some hours and than the error appears. After some hours without doing anything it works again and than the error comes back. But I really have no idea why. Some weeks ago all worked fine for month. Nothing changed. The fusion solar app is working.

Harald1387 avatar May 28 '24 08:05 Harald1387

Hi! I think that I somehow fixed that problem. I’d just simply connected my inverter via wired connection, using Waveshare RS485 to ETH(B) POE Modbus Gateway.
The integration has been working perfectly for almost two months. Thera are no errors or disconnections.

My current versions:

Home Assistant

Core 2024.5.5 Supervisor 2024.05.1 Operating System 12.3 Frontend 20240501.1

Huawei solar : 1.3.4b1

Almetu avatar May 28 '24 11:05 Almetu

I did not get the integration to work anymore. As I found it not very reliable and it stopped working several times over time, I switched to the native modbus integration via Modbus proxy. Modbus proxy is running on an old raspberry connected to the short ranged Wifi of the inverter and via cable to the home network.

configuration.yml huawei-sun-2000.yaml

dkrebs avatar May 28 '24 11:05 dkrebs

v1.4.0 is out

wlcrs avatar Jun 15 '24 18:06 wlcrs

And I still have the same problem. Every time there is an update to HA Core or Supervisor the integration does not load. No error messages appear and the only solution is to delete the integration and it's config and remove it from HACS. Reboot and and redownload and install from scratch - the whole process takes about an hour as I if I don't restart HACS after every step it fails to install.

themaninspain avatar Jun 24 '24 16:06 themaninspain

@wlcrs Having the same issue with v1.4.1 and Core 2024.6.4

homeassistant  | 2024-07-02 21:39:37.290 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration huawei_solar: No module named 'huawei_solar'

I'm using HA in a docker container, also had to add the mount ./local:/.local because it tries to write some stuff there, maybe it's a good idea to mention this somewhere, or to write everything into /config as the docs currently indicates.

brusch avatar Jul 02 '24 19:07 brusch

Uninstall / installed fixed it. Works now. Sorry 😊

brusch avatar Jul 02 '24 20:07 brusch

I just wanted to say that I've now update to HA Core 2204.7.2 with no problems!

themaninspain avatar Jul 11 '24 16:07 themaninspain