-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Poor performance in climate mode #282
Comments
I have this issue also. I'm seeing 3 to 4 per second per integration. I have 18 tilt blinds most on the west and south walls. Several I need to control independently so that I can disable the integration when I don't want the blinds to open. If I run enough instances to do what I want, the CPU is taxed so much the whole home assistant becomes unresponsive. If pushed too hard it reboots. Debug log with just once instance enabled.
|
What version of Adaptive Cover are you using?
1.4.2
What version of Home Assistant are you using?
2024.8.0
Checklist
Describe the issue
I have a template weather entity created from various entities from a tempest weather station. The tempest updates frequently, so the template weather entity also updates frequently.I created an instance of this integration in climate mode using this weather entity, and I noticed very high CPU usage after creating this instance. I could barely use homeassistant, so I did some debugging.
It looks like
coordiator.async_check_entity_state_change
gets fired multiple times a second from this particularly talkative weather entity. This causes shade position to get calculated multiple times a second, as well asnormal_cover.solar_times
, which is created in a separate thread.I'm guessing the integration is spawning multiple threads per second to run
solar_times
, which is what is causing the high CPU load. I modified thecoordinator.py
file to only runsolar_times
on first refresh or if the entity that fired the state change event issun.sun
, and this resolved the CPU load issue, but the End Sun and Start Sun entities are now Unknown. I must have gotten some logic wrong about when and how to update them.I also think there are multiple improvements that could be made in terms of how often calculations are run in climate mode beyond this one, such as ignoring weather entity events that don't modify the temperature or condition.
Reproduction steps
Create an instance of the integration in climate mode with a talkative weather entity.
Observe CPU load and responsiveness of the system.
Remove the
loop.run_in_executor
call to runnormal_cover.solar_times
incoordinator.py
.Restart homeassistant.
Observe improved CPU load and responsiveness of homeassistant.
Diagnostics dump
No response
The text was updated successfully, but these errors were encountered: