StephanJoubert / home_assistant_solarman

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

All sensors show as unknown #537

Open dmartin794 opened 3 months ago

dmartin794 commented 3 months ago

Solarman integration via HACS was working fine until last night. From what I can tell nothing changed, except the laptop that I am running HA on updated and rebooted. Can still connect to Inverter via IP, and Inverter is still connected to Solarman Smart and pushing data. When looking at the logs in HA I have the following error:

NoSocketAvailableError: No socket available (SyncWorker_4) [custom_components.solarman.solarman] Querying [3 - 112] failed with exception [NoSocketAvailableError: No socket available] On the entity I have an alert: This entity is no longer being provided by the solarman integration. If the entity is no longer in use, delete it in settings. Using HA 12.1 with 2024.3.0 Core.

giedriuskilcauskas commented 3 months ago

Most likely docker was updated. There were some other issues opened and workaround was to downgrade it and lock.

parkflyer commented 3 months ago

Hi! I have the same problem (same errors as above) around every 2-4 days (since several months now). Restarting HA solves the issue, but is no real solution. Is there a possibility to reload the integration without restarting HA? I'm using a Deye 12K, all components are in their current version.

darkman82 commented 3 months ago

Hi, open SSH Terminal and run: netstat -anp | grep 8899

How many connections do you see?

Mine did the same every 4-5days, then I found out that the exception/retry mechanism in solarman.py was leaking too many TCP connections in CLOSE_WAIT and once they reached 90 (limits may vary in other systems), the integration stopped working.

Currently I'm testing some changes in solarman.py, avoiding disconnect/reconnection on every single error, by letting the pysolarmanv5 module to handle the connection (with auto_reconnect=true). Seems stable, but I'd like to wait a couple of weeks.

parkflyer commented 3 months ago

Caro Guiseppe!

“netstat -anp | grep 8899” returns nothing (entered in HA Terminal).

Solarman currently runs without problems (last “hang” was 2 days ago).

netstat –anp returns:

Con cordiali saluti,

Ewald

Von: Giuseppe @.*** Gesendet: Freitag, 29. März 2024 21:33 An: StephanJoubert/home_assistant_solarman Cc: parkflyer; Comment Betreff: Re: [StephanJoubert/home_assistant_solarman] All sensors show as unknown (Issue #537)

Hi, open SSH Terminal and run: netstat -anp | grep 8899

How many connections do you see?

— Reply to this email directly, view it on GitHub https://github.com/StephanJoubert/home_assistant_solarman/issues/537#issuecomment-2027709470 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BCFO5L6KNBOM2NJVP2QBGTDY2W6WZAVCNFSM6AAAAABEVOFNOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXG4YDSNBXGA . You are receiving this because you commented. https://github.com/notifications/beacon/BCFO5LZJQM3IUCTK2TSGC4TY2W6WZA5CNFSM6AAAAABEVOFNOWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTY3RSB4.gif Message ID: @.***>

darkman82 commented 3 months ago

Hi, you should run netstat when the system hangs, however you should always see at least one connection. Are you using the stick logger on the standard port (8899) ?

parkflyer commented 3 months ago

Dear Guiseppe!

Yes, I’m using the WLAN stick on the Deye on port 8899:

I can connect via the web interface via the IP address (also when Solarman is not responding any more).

Note that I also have a Wifi Modbus adapter (https://github.com/klatremis/esphome-for-deye) connected to my Deye which works flawlessly.

But I got the HA Energy Dashboard only working with Solarman.

I’m using DuckDNS as DynDNS to access my HA / Raspberry Pi (not sure of this is important).

I also do not have a connection to any Remote Server for the Deye:

Anyway for most of the time it works OK.

Sincerely,

Ewald

Von: Giuseppe @.*** Gesendet: Samstag, 30. März 2024 18:38 An: StephanJoubert/home_assistant_solarman Cc: parkflyer; Comment Betreff: Re: [StephanJoubert/home_assistant_solarman] All sensors show as unknown (Issue #537)

Hi, you should run netstat when the system hang, however you should always see at least one connection. Are you using the sticker logger on the standard port (8899) ?

— Reply to this email directly, view it on GitHub https://github.com/StephanJoubert/home_assistant_solarman/issues/537#issuecomment-2028354233 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BCFO5L3NDVAHSCI5HKZGXF3Y23S7ZAVCNFSM6AAAAABEVOFNOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGM2TIMRTGM . You are receiving this because you commented. https://github.com/notifications/beacon/BCFO5LZQKOEIO3OWECBNXIDY23S7ZA5CNFSM6AAAAABEVOFNOWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTY4Y5LS.gif Message ID: @.***>

darkman82 commented 3 months ago

Have a look at #523

parkflyer commented 2 months ago

Thanks, I‘ve applied the fix you mentioned and it is now working for longer than a week, no problems since then!