StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
544 stars 198 forks source link

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

Open Jan-Ole-Menz opened 11 months ago

Jan-Ole-Menz commented 11 months ago

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

PV-Joe commented 11 months ago

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

I think 1.5.1 is faulty.

Jan-Ole-Menz commented 11 months ago

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

etam commented 11 months ago

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]

kasper0 commented 11 months ago

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

Jan-Ole-Menz commented 10 months ago

Since I downgraded to 1.4.3 it's running perfectly.

etam commented 10 months ago

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

kasper0 commented 10 months ago

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

etam commented 10 months ago

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.

OneScuzzie2k commented 10 months ago

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

kasper0 commented 10 months ago

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

@OneScuzzie2k Could you share the HA log?

Jay66Bee commented 10 months ago

I am having the same problem.

How do I roll back to 1.4.3 ?

Thanks.

Jan-Ole-Menz commented 10 months ago

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

Reinqusito commented 10 months ago

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

etam commented 10 months ago

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.

Jay66Bee commented 9 months ago

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 commented 9 months ago

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.

vinceg0267 commented 8 months ago

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)

JPEloff commented 7 months ago

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.

kilian1024 commented 4 months ago

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.

PV-Joe commented 4 months ago

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

kilian1024 commented 4 months ago

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?

PV-Joe commented 4 months ago

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.

kilian1024 commented 4 months ago

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

PV-Joe commented 4 months ago

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.

Pigi-102 commented 4 months ago

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

mario37359 commented 1 month ago

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

PV-Joe commented 1 month ago

Go and install this version:

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

More Sensors 5 sec Intervall

It works perfectly with Deye!

bert1111 commented 1 month ago

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

mario37359 commented 1 month ago

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

PV-Joe commented 1 month ago

Ask here to get full support:

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