custom-components / sensor.owlintuition

A set of sensors to integrate the OWL Intuition devices network
MIT License
11 stars 9 forks source link

HA logs growing quickly with Owl intuition warnings #32

Open CarlNightingale opened 1 year ago

CarlNightingale commented 1 year ago

Hi, Please see the attached log screenshots. This seemed to start after I updated to the latest patch a few days ago. Is the anyway to prevent the warnings being written to the logs or to change the parameters to reduce the number of records please?

Thanks in advance

log Screenshot 2023-07-01 170101 log1 Screenshot 2023-07-01 170001

glpatcern commented 1 year ago

Hi there, Missed this earlier, sorry. For the Impossible energy consumption measure errors, I'll have a look as it seems coming from the sensor - and it may well be that things changed in HA.

For the other warnings, they come from HA core and are due to the fact that this integration gets updates synchronously (and "slowly", OWL sends an update every 30-60 seconds). Some years ago I attempted to go async but that made HA totally unstable, I was likely not doing the right thing and/or the async support in HA was not yet mature enough. I never tried again afterwards and can't promise anything at this stage. Of course I'd be happy to review a contribution in a PR for this feature.

shortbloke commented 1 year ago

You may also want to look at your logger configuration, perhaps changing your default level to error and then specifying higher log levels for components and services you're troubleshooting.

glpatcern commented 9 months ago

For (my) future reference, https://github.com/home-assistant/core/compare/dev...Galorhallen:core:govee-local-api#diff-928dc93a5708a4616e87c0cd2f2ac47141bdb03d1226e8bc5c2eea2b41f3d8f1R27-R41 is a new integration in HA that uses asyncio with the HA main loop, and https://github.com/Galorhallen/govee-local-api/blob/develop/src/govee_local_api/controller.py#L97-L100 is how the listener is initialized

tluethi71 commented 9 months ago

For (my) future reference, home-assistant/core@dev...Galorhallen:core:govee-local-api#diff-928dc93a5708a4616e87c0cd2f2ac47141bdb03d1226e8bc5c2eea2b41f3d8f1R27-R41 is a new integration in HA that uses asyncio with the HA main loop, and https://github.com/Galorhallen/govee-local-api/blob/develop/src/govee_local_api/controller.py#L97-L100 is how the listener is initialized

Will this solve the long startup procedure? I had a look at it but honestly I dont understand what I have to do...

glpatcern commented 9 months ago

Will this solve the long startup procedure? I had a look at it but honestly I dont understand what I have to do...

This might solve it, yes, but it requires a major refactoring of the code and a developer-level understanding of async loops.

I may have time to review a PR on this, but can't commit myself to such task for now.

tluethi71 commented 9 months ago

hey @glpatcern grazie mille. ;) then I will wait. I had to uninstalled it as every reboot is taking so long and I dont know how I can get rid of the owl-startup message. I only use it for my triphase owl sensor...

glpatcern commented 9 months ago

Prego ;) the comment above suggests to change the log level, for the startup time I also use it for the triphase and I find it acceptable (the rest of HA normally runs), then of course it's your choice