elupus / hass_nibe

Home Assistant Nibe Uplink Integration
183 stars 54 forks source link

The startup times of the integration are getting insane #112

Open DenisMir opened 2 years ago

DenisMir commented 2 years ago

I don't know if that is normal. But the startup times of the extension are getting insane. (> 10 minutes)

It is also a problem that all systems in Nibeuplink get collected automatically since one of the last releases. Now I got 10 external systems that I'm following automatically that I didn't want. (I just recognized that in the last minutes while browsing through the integrations) And it is an absolute mess getting rid of all these devices manually.

I would bet that these multiple devices slow down the startup this much.

elupus commented 2 years ago

I was a bit afraid people might have many systems. You can disable the devices from gui. However, since separate devices are added for diagnostics. It get messy. I will ponder a bit.

DenisMir commented 2 years ago

Thank you for the explanation. It would be great if these "special" devices could include the system ID. Otherwise you have to open each one of them to know who they are.

Bildschirmfoto 2021-11-15 um 08 12 15

But what I don't get is why one would like to include multiple systems. The default case is that a user has one heat pump in his house. So selecting the correct one like it was before was the correct approach.

In the end even with having these hundreds of sensors disabled and the devices deactivated the startup of this integration is now > 10 minutes which blocks the whole system.

elupus commented 2 years ago

The cause was people having hard time setting up the integration. But I suppose i could add a option flow to select the systems wanted.

Ah right. Forgot that it still needs to load data once to figure out enough data to start.

The slow start is a self imposed limitation to meet API limita, of which i don't know if we really technically even need during startup.

elupus commented 2 years ago

The names should include system id. Btw. Maybe your have been renamed at some point.

elupus commented 2 years ago

I added preliminary support to selecting systems in option flow. Sadly a bit too late, since it's not part of config flow yet. So it will still load on start. Also it won't clean up the added devices yet. But should get your startup time down.

henning89 commented 2 years ago

Since I updated to the latest release of this integration, the data is not refreshed anymore automatically. Seems that data is pulled once during home assistant startup and then no refresh for hours. Not sure whether it is related to this issue but maybe this is due to API restrictions? I have only one system registered in Nibe Uplink.

elupus commented 2 years ago

Update again