wimb0 / home-assistant-saj-r5-modbus

Home Assistant Component for reading data locally from SAJ R5 (and Zonneplan One) Inverters through modbus TCP.
MIT License
31 stars 14 forks source link

UI locks when communication time-outs occur #80

Closed Lvdvvdk closed 4 months ago

Lvdvvdk commented 5 months ago

Hi, I am using the modbus integration for my SAJ R5 inverter and utilize the Elfin EW-11A as interface. During the day multiple communication time-outs occur which are logged as follows:

_2024-03-18 16:18:11.116 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 5.014 seconds (success: True) 2024-03-18 16:19:16.109 ERROR (SyncWorker_13) [pymodbus.logging] Connection to (192.168.50.233, 5555) failed: timed out 2024-03-18 16:19:16.112 ERROR (MainThread) [custom_components.sajmodbus.hub] Reading realtime data failed! Inverter is unreachable

What could be the reason of the timeouts? I have connected the EW11 as described in the README with the SAJ providing the power. Is it better to use an external power supply? When time-outs are happening the HA UI is partly frozen.

Thanks

HindrikDeelstra commented 5 months ago

It's probably not caused by this integration, but by WiFi connection issues.

When I started using this integration, SAJ R5 Modbus via an Elfin EW10, I initially had similar troubles. My inverter is located in the attic, and the interference of the solar DC cables seemed to be just enough to interrupt the WiFi communications. I had placed the EW10 and its cable alongside the solar DC cables, for convenience.

To solve the connectivity issues, I re-arranged the orientation of the EW10 unit and the connecting cable, so no part of it runs parallel or near to the solar DC cables. This has fixed the issue for me, I've not seen any WiFi disruptions since.

If re-arranging the cable trajectory does not help for you, you could try to improve your WiFi signal by adding or moving an AP closer to your EW11 unit.

Lvdvvdk commented 5 months ago

It's probably not caused by this integration, but by WiFi connection issues.

When I started using this integration, SAJ R5 Modbus via an Elfin EW10, I initially had similar troubles. My inverter is located in the attic, and the interference of the solar DC cables seemed to be just enough to interrupt the WiFi communications. I had placed the EW10 and its cable alongside the solar DC cables, for convenience.

To solve the connectivity issues, I re-arranged the orientation of the EW10 unit and the connecting cable, so no part of it runs parallel or near to the solar DC cables. This has fixed the issue for me, I've not seen any WiFi disruptions since.

If re-arranging the cable trajectory does not help for you, you could try to improve your WiFi signal by adding or moving an AP closer to your EW11 unit.

Thanks for your advice The distance between the EW11 and AP is ~2m but I shall try to reposition the EW11 to see if that has any effect. Can you clarify why the communication time-outs freeze the UI?

wimb0 commented 5 months ago

Are you sure the UI freezes are caused by this integration? I've never seen this behaviour before.

Lvdvvdk commented 5 months ago

Yes, I am sure about that because the log shows that connection time-outs have occurred during the UI problems Perhaps is "freeze" not the correct description. What I mean is that some features can still be selected, but others, such as selecting a particular dashboard or selecting the integration menu, will result in a "waiting" symbol. In the meantime I have discovered that the connection problems have to do with my Wifi Mesh router. Although located a few meters from an AP, the EW11 had a connection with another remote one. 2 days ago I changed my router configuration to force the EW11 to connect to the nearest AP and since then no more connection timeouts (and UI side effects) occur

wimb0 commented 4 months ago

I am not sure why this happens. If the freezes are occuring when the EW11 is offline, everyone using this integration should have this issue at night, when the inverter is offline. You are the first to mention this. I have not seens this issue myself. Maybe someone else can verify this?

wimb0 commented 4 months ago

I am closing this issue, as it is not caused by this integration.