-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Slowdown of home assistant #27
Comments
Could you give me some insights? What hardware are you using? Have you built charts with the data? What does the hardwares utilization look like before and after installing (if available) |
Another thing, it seems you have debug logging enabled, this repo has a lot of debugging logs, so turning this on will spam the logs, and likely slow down devices that write to SD cards, so my first suggestion would be to disable debug logging, and see if this resolves the issue. |
I had debug loggin enabled from the integration page of modbus to hopefully see more what was wrong its not always on. Hardware wise I should not have any bottlenecks 19 integrations running no problem everything snappy loading within a second of clicking, have not setup up anything like graphs or automations yet just the integrations But when I enable this one clicking on something or freshing the page can take up to 10 seconds cpu utilization have not seen it go over 4%, ram at 7-12% Fresh Home Assistant OS 11.2 vdi (virtualbox) Datalogger stick: Solis-DLS-L |
Okay it's a peculiar issue. Do you know how to modify the integrations files? Inside the const file you can change the interval of scans, if this works I will prioritize #15 |
Ok i did try POLL_INTERVAL_SECONDS = 10 before i made the issue but at the time it did not seem to help Testing again Using 30 now because this way its less noticable, can still reproduce every 30 seconds doing a reload or interacting with home assistant it will hang for a few seconds. Not sure how you get the data from the logger is it not 1 call or is it big that it takes a while, or is it my older datastick donno, but maybe what you said in #15 about not updating all the field every times make a difference. |
So there are about 5 calls done, to avoid multiple calls. The menory used should be low since it's all U16 values. NO response received will be noticed from time to time, this can be due to a timeout. Could you do a ping test from your HA hardware to your inverter to see how stable it is? It could be a timeout issue if perhaps larger than 100ms (need to verify) |
Ping test where 2 times the polling happend and notice page loading for a few seconds but the ping test shows nothing strange and keeps pinging trough the hangs. 33 packets transmitted, 33 packets received, 0% packet loss Tought I eliminated most errors with higher polling rate, running for 24hours+ now and sadly still errors:
|
I'll test this weekend on my desktop with the VMware image to see if the same thing happens. Did not test with new version maybe #29 helps |
Test on desktop with latest 11.3 vmware image with only this integration and can reproduce slowdown every 15 seconds If others don't have this I suspect it's because of a different datalogger |
Are you able to do a short video of the slowdown? Even if the datalogger is to blame, it's not suppose to slow down your system, so will have a look over the weekend to see what might be causing this. |
refreshing the page every second you see it at 14 and 30, just before the next polling at 45 I click on system info. Solis.modbus.mp4 |
@neox387 it's been a while since you opened this issue, and not sure if you are still using the integration. If you are, could you please see if version |
Hi, I've the same issue, my home assistant is slower with this plugin installed. |
Which version are you running of the plugin? |
The latest one, 1.4.1 on HA Yellow. |
Okay please keep me updated if there is slowdown again |
Sometimes it feels like HA takes longer to load or react but it can just be me of course :-) is there a way to disable fetching data I don’t need? So maybe make it faster? thx for the fast response!! And great addon! |
@Pho3niX90 it feels like it is the same as in the video of @neox387, so it sometimes takes longer to load a page. |
Okay will investigate a solution today. |
Wow, nice. |
@Pho3niX90 BTW I have this Solis inverter: Solis RAI 3kW. |
@Pho3niX90 if you need me to test things, let me know, happy to help! |
I removed the plugin and HA was fast/normal again. |
No no there are no missing registers, everything is visible, but I can only control these in the screenshot. |
The version number in the system has been updated from 1.4.3 to 1.4.4 in both manifest.json and const.py. Additionally, error handling for modbus operations within modbus_controller.py has been updated to streamline failure responses, eliminating unnecessary error check steps and focusing on exception-based error handling. fixes #43 and #27
* Refactor update methods and adjust poll intervals Changed the 'async_update' methods to just 'update' in sensor.py, number.py, and switch.py files. Additionally, the poll intervals have been adjusted. These modifications aim to enhance the efficiency and timing of data updates. * Update async operations in sensor.py The async operations for updating sensor entities have been refactored and encapsulated in a new function `get_modbus_updates`. This improves the asynchronous handling of updates, making the code more efficient and organized. * Switch to async Modbus operations for responsiveness Refactored Modbus reading methods across several components to use asynchronous operations. This allows the event loop to manage other processes to keep the system responsive, particularly during heavy IO operations. * Update version and clean error handling in Modbus operations The version number in the system has been updated from 1.4.3 to 1.4.4 in both manifest.json and const.py. Additionally, error handling for modbus operations within modbus_controller.py has been updated to streamline failure responses, eliminating unnecessary error check steps and focusing on exception-based error handling. fixes #43 and #27 * Switch Modbus operations to asynchronous version Switched all write operations in Modbus component to their asynchronous counterparts, starting from calling the asynchronous version of write methods in modbus_controller.py, propagated through other components like time.py, sensor.py, and more. This change aims to boost performance by leveraging Python's native async features. Logging statements unrelated to debugging were also removed to clean the code.
* - bump version * - bump version * Refactor update methods and adjust poll intervals Changed the 'async_update' methods to just 'update' in sensor.py, number.py, and switch.py files. Additionally, the poll intervals have been adjusted. These modifications aim to enhance the efficiency and timing of data updates. * Update async operations in sensor.py The async operations for updating sensor entities have been refactored and encapsulated in a new function `get_modbus_updates`. This improves the asynchronous handling of updates, making the code more efficient and organized. * Switch to async Modbus operations for responsiveness Refactored Modbus reading methods across several components to use asynchronous operations. This allows the event loop to manage other processes to keep the system responsive, particularly during heavy IO operations. * Update version and clean error handling in Modbus operations The version number in the system has been updated from 1.4.3 to 1.4.4 in both manifest.json and const.py. Additionally, error handling for modbus operations within modbus_controller.py has been updated to streamline failure responses, eliminating unnecessary error check steps and focusing on exception-based error handling. fixes #43 and #27 * Switch Modbus operations to asynchronous version Switched all write operations in Modbus component to their asynchronous counterparts, starting from calling the asynchronous version of write methods in modbus_controller.py, propagated through other components like time.py, sensor.py, and more. This change aims to boost performance by leveraging Python's native async features. Logging statements unrelated to debugging were also removed to clean the code. * Replace synchronous Modbus operations with asynchronous The Modbus operations have been replaced with their asynchronous counterparts in modbus_controller.py, number.py, and time.py. The switch to asynchronous operations aims to improve performance by effectively utilizing Python's in-built asynchronous features. Logging messages unrelated to debugging have been removed for a cleaner codebase. * Implement asynchronous Modbus operations Switched synchronous Modbus functions to their asynchronous variants to leverage Python's asyncio capabilities and improve performance. Debugging-specific logging messages have been removed to tidy up the codebase. Asynchronous operations were adopted in files like modbus_controller.py, number.py, and time.py.
Since installation my home assistant web pages can sometimes take up to 10 seconds to load
This is also causing issue with other services for example a kodi ping starts to fail
The registers that failed to read can vary while other times they are reading normal and happends on these: read_input_register / read_holding_register
The text was updated successfully, but these errors were encountered: