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

Connection Refused - Leads to Unresponsive Home Assistant #235

Open
sockmonkey0223 opened this issue May 23, 2024 · 8 comments
Open

Connection Refused - Leads to Unresponsive Home Assistant #235

sockmonkey0223 opened this issue May 23, 2024 · 8 comments

Comments

@sockmonkey0223
Copy link

I've replaced my inverter in the past. After making sure all settings were the same, the integration continued to work fine.

I replaced my inverter again yesterday (yay SolarEdge!). All modbus settings are the same and IP address the same. The inverter is connected via Ethernet. The integration worked for a while but then started reporting "connection refused". I've verified the inverter is still reachable.

More interesting is that if I allow this to continue, it causes HA to become unresponsive and I need to perform a "core restart". I have to disable the integration to prevent this.

Logs:
2024-05-23 13:43:09.410 DEBUG (MainThread) [custom_components.solaredge_modbus] Setup solaredge_modbus.solaredge
2024-05-23 13:43:39.415 INFO (SyncWorker_55) [custom_components.solaredge_modbus] modbus client is not connected, trying to reconnect
2024-05-23 13:43:39.416 INFO (SyncWorker_55) [custom_components.solaredge_modbus] successfully connected to 192.168.69.220:1502
2024-05-23 13:44:08.447 DEBUG (SyncWorker_55) [custom_components.solaredge_modbus] Could not read Active Power Limit
2024-05-23 13:45:35.575 DEBUG (SyncWorker_14) [custom_components.solaredge_modbus] Could not read Active Power Limit
2024-05-23 13:46:33.758 DEBUG (SyncWorker_51) [custom_components.solaredge_modbus] Could not read Active Power Limit
2024-05-23 13:47:02.783 DEBUG (SyncWorker_2) [custom_components.solaredge_modbus] Could not read Active Power Limit
2024-05-23 13:47:03.856 ERROR (SyncWorker_13) [pymodbus.logging] Connection to (192.168.69.220, 1502) failed: [Errno 111] Connection refused
2024-05-23 13:47:03.856 ERROR (SyncWorker_13) [custom_components.solaredge_modbus] Error reading modbus data
Traceback (most recent call last):
File "/config/custom_components/solaredge_modbus/init.py", line 247, in _refresh_modbus_data
update_result = self.read_modbus_data()
^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 322, in read_modbus_data
and self.read_modbus_power_limit()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 737, in read_modbus_power_limit
inverter_data = self.read_holding_registers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/solaredge_modbus/init.py", line 305, in read_holding_registers
return self._client.read_holding_registers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymodbus/client/mixin.py", line 102, in read_holding_registers
return self.execute(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymodbus/client/base.py", line 176, in execute
raise ConnectionException(f"Failed to connect[{self!s}]")
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.69.220:1502)]

@praveenvsn
Copy link

I have the same issue. I just have a single meter with no battery. The Solaredge_m1_imported_kwh and Solaredge_m1_exported_kwh are always -0.0 even though the energy is exported to florid and imported from grid.

@sockmonkey0223
Copy link
Author

sockmonkey0223 commented Jul 31, 2024

I finally started digging into this issue again and discovered that in my Inverter configuration, I had the RS485 setting as "Solar Edge Follower" instead of "SolarEdge Leader". When I corrected that, the integration was once again able to communicate with the inverter.

The documentation from https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki/Configuration helped me figure this out.

I still consider it a problem that the integration causes HA to crash if it cannot communicate.

Edit: changing this setting did not solve the connectivity problem.

@gerco
Copy link

gerco commented Aug 24, 2024

I have the same issue here, my inverter is connected over somewhat shoddy WiFi. This leads to frequent communication failures and makes my home assistant unusable with this integration enabled since it becomes unresponsive to the point of having to power-cycle it to get it back online about every 20-30 minutes.

@gerco
Copy link

gerco commented Aug 26, 2024

I worked around the issue using a different integration for now. I tried to debug this one, but had trouble setting up a development environment for it so I didn't pursue that any further. In case anyone else wants to replicate my results, here is a modbus config gist.

This needs to be combined with a set of helpers that convert these values to proper sensors with units of measure, device_class, state_class and scale factor taken into account, etc. It's not a super-easy thing to do and using this integration would be heaps easier and recommended over this hack.

@EddyBurnett
Copy link

Same issue here, got 3 inverters (two single phase and one 3-phase) and sinds a week or two I had communications failures with the 3-phase inverter and it keeps crashing HA.
In order to bring HA up I need to reboot the HA Core in order to fix it for a short time or simply disable only the integration for the 3-phase inverter.

One thing to notice is that the 3-phase inverter has a newer firmware update (4.21.23) and the others are lagging behind with an older version.

Searching now for another integration.

@peter-dolkens
Copy link

I ended up going with https://github.com/WillCodeForCats/solaredge-modbus-multi - no issues so far

@EddyBurnett
Copy link

Yeah already just installed it and renamed some sensors to keep my history. Works like a charm👍

@devdems
Copy link

devdems commented Dec 3, 2024

Any update on this topic? This should be very urgent as HA is becoming unresponsive. Switching to a different integration is a hassle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants