home_assistant_solarman icon indicating copy to clipboard operation
home_assistant_solarman copied to clipboard

Regularly getting disconnected status on my Homeassistant Solarman Intergration (Deye SUN-12K-SG04LP3-EU)

Open Jan-Ole-Menz opened this issue 1 year ago • 30 comments

The integration goes from working perfectly to status_connection: disconnected without any interaction from my side.

In the HA logs I find this: WARNING (SyncWorker_2) [custom_components.solarman.solarman] Querying [3 - 89] failed with exception [OSError: [Errno 24] No file descriptors available]

Restarting HA fixes the issue temporarly until the next disconnected (trice this week).

I'm running Solarman integration 1.5.1 via HACS

Jan-Ole-Menz avatar Oct 25 '23 13:10 Jan-Ole-Menz

Downgrade to 1.4.3. It works fine with my Deye Hybrid 8K.

I think 1.5.1 is faulty.

PV-Joe avatar Oct 25 '23 14:10 PV-Joe

Thanks for the info, hav downgraded to 1.4.3, if it occurs again will post here then.

Jan-Ole-Menz avatar Oct 25 '23 14:10 Jan-Ole-Menz

I also have this problem. It might be related to a change in pysolarmanv5: https://github.com/jmccrohan/pysolarmanv5/blob/main/CHANGELOG.md#v300---2023-05-21

Prior to this, the socket was implicitly closed when the PySolarmanV5 object was deferenced. Many dependent applications re-instantiate a new object for each poll. These applications will need to either remain on v2.4.0, or upgrade to v3.0.0 and ensure disconnect() is called to close the connection cleanly.

Edit: theoretically it was addressed in #375 , but maybe there's some edge case missing? More info required...

Edit 2: My log contains

WARNING (SyncWorker_0) [custom_components.solarman.solarman] Querying [1028 - 1056] failed with exception [NoSocketAvailableError: Connection closed on read]

etam avatar Oct 28 '23 10:10 etam

@Jan-Ole-Menz, @etam Could you verify if the issue occurs when auto_reconnect is set to false?

kasper0 avatar Nov 08 '23 22:11 kasper0

Since I downgraded to 1.4.3 it's running perfectly.

Jan-Ole-Menz avatar Nov 09 '23 07:11 Jan-Ole-Menz

I can try. I run the latest version and I'm restarting HA once in a while.

You're asking to edit this line? https://github.com/StephanJoubert/home_assistant_solarman/blob/aed4c7aad3b5c5677671ea2b74e05415a13ff10b/custom_components/solarman/solarman.py#L39

etam avatar Nov 09 '23 11:11 etam

Yes, this line, thank you. It seems that disabling auto-reconnect mechanism prevents leaking file descriptors.

kasper0 avatar Nov 09 '23 11:11 kasper0

So far so good. I checked the HA process with lsof and it seems that there are no leaks. Current uptime is 2 days, though. I'll report again in a few days.

etam avatar Nov 14 '23 20:11 etam

I can try. I run the latest version and I'm restarting HA once in a while.

You're asking to edit this line?

https://github.com/StephanJoubert/home_assistant_solarman/blob/aed4c7aad3b5c5677671ea2b74e05415a13ff10b/custom_components/solarman/solarman.py#L39

I have done this, and today after 3 days mine has gone down again, rolling back to 1.4.3

OneScuzzie2k avatar Nov 17 '23 08:11 OneScuzzie2k

Mine has been working correctly since I turned off the auto-reconnect feature a week ago.

@OneScuzzie2k Could you share the HA log?

kasper0 avatar Nov 17 '23 09:11 kasper0

I am having the same problem.

How do I roll back to 1.4.3 ?

Thanks.

Jay66Bee avatar Dec 04 '23 07:12 Jay66Bee

In HA under HACS, click on the vertical ... and select redownload, in the pop-up you will find select version you open the dropdown and select 1.4.3 and finally click download

Jan-Ole-Menz avatar Dec 04 '23 08:12 Jan-Ole-Menz

same issue with 1.5.1 (never a problem with previous version). Downgraded to 1.4.3 and everything back to work perfectly.

Reinqusito avatar Dec 06 '23 15:12 Reinqusito

Meanwhile my instance has almost 24 days of uptime and no problems so far.

For the record: As written in comment above, I have changed auto_reconnect to False.

etam avatar Dec 06 '23 15:12 etam

In HA under HACS, click on the vertical ... and select redownload, in the pop-up you will find select version you open the dropdown and select 1.4.3 and finally click download

I reloaded to 1.4.3 and reloaded HA but integration still showing 1.5.1 is that normal or did it fail to roll back?

Jay66Bee avatar Dec 09 '23 08:12 Jay66Bee

Changing auto_reconnect=True to False for my KStar inverter did not stop the disconnection.

I have successfully rolled back to 1.4.3

Any benefits of 1.5.X and thereafter will have to wait until it is proven to work.

Jay66Bee avatar Dec 13 '23 08:12 Jay66Bee

Changing auto reconnect to false do not work for me. Since I have another instance of HA that I use for testing, which still has version 1.4.3, I made two screenshots. So version 1.4.3. it doesn't disconnect often, the problem is that it often shows anomalous data with spikes.

Screenshot (79)

Screenshot (80)

vinceg0267 avatar Jan 16 '24 05:01 vinceg0267

Hi. My Solarman integration keeps disconnecting. I change auto reconnect to false but no luck. I am trying to downgrade from 1.5.1 to 1.4.3 but I get this message : "The version selector will be removed in a future release. If you need to install a specific version, you can do so by using the service call for update entities." How do I downgrade? Please help.

JPEloff avatar Mar 03 '24 16:03 JPEloff

Hi. My Solarman integration keeps disconnecting. I change auto reconnect to false but no luck. I am trying to downgrade from 1.5.1 to 1.4.3 but I get this message : "The version selector will be removed in a future release. If you need to install a specific version, you can do so by using the service call for update entities." How do I downgrade? Please help.

Hi, had the same issue... Hope you already got this. In case someone else stumbles over this and needs help (took me an hour to find out...): Go to Developer Tools -> Services and use the service update.install

Choose update.solarman_integration_update as the Entity you want to update (make sure you use the entity, not the device). If you can not find the update entity, make sure that experimental features are enabled in the HACS Configuration.

Check the Version box and insert v1.4.3 and fire away. You will get an error if you got something wrong but no "update successful" screen or something like that if you got it right.

Wait a Minute and restart home assistant. If you have auto updates on the integration enabled, you can see that it worked because home assistant found the update to the newer version. Make sure to skip this so you do not update again.

kilian1024 avatar May 11 '24 06:05 kilian1024

Delete all remaining files with File editor after uninstalling and before downgrading to 1.4.3.

PV-Joe avatar May 11 '24 06:05 PV-Joe

Delete all remaining files with File editor after uninstalling and before downgrading to 1.4.3.

Could you get more detailed on how to do that?

kilian1024 avatar May 11 '24 06:05 kilian1024

Delete all remaining files with File editor after uninstalling and before downgrading to 1.4.3.

Could you get more detailed on how to do that?

Go to folder: custom components > Solarman

Delete all remaining files and restart before installing 1.4.3.

PV-Joe avatar May 11 '24 06:05 PV-Joe

yeah, but going the way with updating over the developer-Tools, you have to have the newer version already installed... So I can't uninstall it before? Or is there a possibility to directly install the older Version? Over HACS, it seems like it is not possible

kilian1024 avatar May 11 '24 06:05 kilian1024

If you have the 1.4.3 files already then:

  1. Delete the files described above
  2. Restart
  3. Manual installation of 1.4.3.
  4. Restart
  5. Configure

1.4.3. runs very stable with my Deye 8K Hybrid updating every 20 seconds by editing the interval.

PV-Joe avatar May 11 '24 07:05 PV-Joe

I have this problem too. Same symptoms. Rollback to 1.4.3 seems a valuable workaround.

Pigi-102 avatar May 17 '24 11:05 Pigi-102

I have a new installation of HA and tried to connect my Deye SUN-M60G4-EU. I started the 1.51 which didnt work and deinstalled and deleted 1.5.1 to try the 1.4.3, which doesnt work, too. The Inverter is reachable on its IP adress aud I cant figure out how to solve the problem. I would be glad to get any hint... TY e1_Screenshot 2024-09-02 111918 e2_Screenshot 2024-09-02 112023 e3_Screenshot 2024-09-02 112204

mario37359 avatar Sep 02 '24 12:09 mario37359

Go and install this version:

https://github.com/davidrapan/ha-solarman

More Sensors 5 sec Intervall

It works perfectly with Deye!

PV-Joe avatar Sep 02 '24 12:09 PV-Joe

Yes I use it too. Works great with my sofar.

bert1111 avatar Sep 02 '24 12:09 bert1111

e5_Screenshot 2024-09-02 151535 Thanks for your fast help. Installed the new version but doesnt work. Any hints on which config file to choose? e4_Screenshot 2024-09-02 151229

mario37359 avatar Sep 02 '24 13:09 mario37359

Ask here to get full support:

https://github.com/davidrapan/ha-solarman/discussions

PV-Joe avatar Sep 02 '24 13:09 PV-Joe