-
Notifications
You must be signed in to change notification settings - Fork 68
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
Causes Unresponsive HA UI #100
Comments
Thanks for reporting this issue @Meatballs1 because I also experience this unresponsive UI when lost connection to the solaredge since forever but never have the chance to open an issue. until now. and thanks for the workaround, too! |
I also can confirm that this works for me |
In order to prevent an unresponsive UI in Home Assistant in case of connectivity issues of the modbus server, the client now uses not the default timeout but a timeout dependent on the selected scan interval. This fixes binsentsu#100
the default timeout for ModbusClient (ModbusTCPClient derives from it) is 3s: https://pymodbus.readthedocs.io/en/latest/source/client.html#pymodbus.client.ModbusBaseClient So you had a scan_interval of 2s greater than default timeout. After that code change you have 1s less than scan_interval. |
If connectivity is lost to the solaredge (replicate with
sudo iptables -I OUTPUT -d 192.168.0.x/32 -j DROP
) the UI becomes very unresponsive.I have modified my DEFAULT_SCAN_INTERVAL to 5s (needs to be changed in core.config_entries after loading the integration) which probably causes the issue due to the timeout period being greater. It doesn't seem to affect a scan interval of 30s (or isn't that noticeable).
The following errors seen in the log (as expected):
I suspect it is blocking the connection for a standard timeout period and probably using up the thread pool but I dont really know a lot about HA internals.
Modifying init.py with the following seems to relieve the issue:
There is also retries=0, reconnect_delay=0 that could help but didn't seem to be required.
The text was updated successfully, but these errors were encountered: