-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Statistics takes longer than 1.111 seconds at startup #110433
Comments
Hey there @ThomDietrich, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) statistics documentation |
The problem is almost certainly in
Its calling It likely needs an optimized version for restoring data |
The whole integration is doing a lot of datetime math could likely be all floats instead since we don't need local time |
forgot to post the yaml configs, sorry, do you need these too, or is it a generic issue btw, the power sensor updates way more frequently than every 5 seconds... it is per state change of the smart meter, and that can be more than once per second so it seems. so, this is using a template sensor (UI) based on 2 integrations (reading smart meter (mqtt) and solar(mqtt)),
then fed into a filter:
and finally the statistics:
|
also, maybe consider, add a polling/update frequency option. seems unnecessary to update this frequently, once a minute should suffice as absolute minimum, maybe even lower. think trigger template, or scan_interval: Aware this has been discussed before, maybe revisit that? |
helps with #110433 but will not fully fix it
This one is still a problem even after #112127 in 2024.4 |
Hey guys, Recently I didn't have the time to add further improvements but I had planned to implement optimizations per characteristic (e.g. for the ( Anyhow. @bdraco back when you worked on #110438 did you compare performance/memory of an extreme use case? |
The problem
running debugpy reveals several remarkable timings during setup.
writing this up per request.
What version of Home Assistant Core has the issue?
2024.2.x
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
statistics
Link to integration documentation on our website
https://www.home-assistant.io/integrations/statistics/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: