-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
O365 Long Load time #269
Comments
Is it that HA is slow to startup and you get errors displayed in the logs saying it is taking too long, or that your dashboard is slow to load? If it is the dashboard, I'm afraid I can't help, I don't do dashboard development. If it is HA reporting errors, then the likely answer is to pull less data. You would need to provide details on your config of the o365/ms365_calendar to enable me to provide any guidance. |
It doesn't matter the dashboard or calendar card, it seems to be in the query of the API. Does it cache the events at all? My config is just based on the default I followed when I set it up |
Assuming you are using MS365_calendar, (if not please migrate to it), then I have added some extra debugging that will show the start and end of any update. So, install ms365_calendar v1.4.0, then enable debug logging (which you can do from the integration page), and you will see the time taken and the calls that are being performed by the O365 library, in the full log. This should help diagnose the issue for you. |
I'll try that, however I can only find v1.3.1, is that expected? |
I see a lot of lines: 2025-02-22 12:08:23.749 WARNING (MainThread) [homeassistant.helpers.entity] Update of calendar.m365_calendar_{name} is taking over 10 seconds some of these: The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. some of these: 2025-02-22 14:14:16.596 WARNING (SyncWorker_8) [urllib3.connectionpool] Connection pool is full, discarding connection: graph.microsoft.com. Connection pool size: 10 A bunch of request and responses from the graph api lots and lots of calendar get events (I have 8 calendars, 1 for each member of the family and a couple of misc ones) |
I'm running this on the home assistant green. and all my calendars are configured like this:
|
The fact that you are getting connection pool errors suggests it is trying to do too much. I would split those calendars across two instances of the integration. You can install again with the same details, just enable different sets of calendars against each instance. |
I really don't know what the spec of a green is or what it can do. You'd have to do some hardware monitoring to see if it is overloaded. I do run a pi for a minor instance, my main instance is a Mac Mini M1 vm, because right back at the beginning a pi wasn't up to the job. |
hmm ok that is probably important, I'll try spliting them up and see what resources its taking. thanks! |
As an fyi, I'm working a way of reducing the number of calls the integration makes for each update every 30 seconds. I'm changing it from 2 to 1 for each calendar. |
It looks to me like that planner dashboard will try to retrieve all of your calendars every time it feels it needs to refresh. Currently that means it will go back to ms 365 to re-retrieve them every time. The change I have proposed above won't help that. The only thing that will likely help is for the events to be cached, which doesn't currently happen and would be a major change, if it can even be done. Given the set of data that needs to be cached is not clear cut, for instance you can page backwards/forwards by months with no limit, and it needs to be updated regularly it is a major undertaking. You may find that trying to manage 10+ calendars in one go is too much. |
I'm using this integration to manage my o365 calendars and display them for my family. I've followed this guidance to make an awesome dashboard (https://community.home-assistant.io/t/diy-family-calendar-skylight/844830) but when applying filters on the m365 calendar entities it takes a really long time. Even when I just open up the default home assistant dashboard it takes a long time to load. Is there a way to optimize the behavior to improve load/reload times?
Thanks,
Kevin Hinton
The text was updated successfully, but these errors were encountered: