home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.79k stars 2.59k forks source link

No entities displayed in /config/entities, and severe lag #21001

Open Mariusthvdb opened 3 weeks ago

Mariusthvdb commented 3 weeks ago

Checklist

Describe the issue you are experiencing

no entities are displayed, and the filter box really lags.

navigating away after trying to load the entities is also suffering the lag, and I need to reload the browser view, to be able to browse the instance again on other views

Describe the behavior you expected

show all entities when nothing is filtered, and show filtered entities when a filter is actually entered

Steps to reproduce the issue

  1. browse to /config/entities
  2. ...

What version of Home Assistant Core has the issue?

2024.6.0b8

What was the last working version of Home Assistant Core?

2024.5

went super fast and smooth

could it be https://www.home-assistant.io/blog/2024/06/05/release-20246/#data-tables-improvements is acting up?

In which browser are you experiencing the issue with?

Any

(edit): Safari, Edge, Chrome, Firefox dont show

iOS companion app shows fine

Which operating system are you using to run this browser?

Sonoma 14.5

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

Scherm­afbeelding 2024-06-05 om 14 53 33 Scherm­afbeelding 2024-06-05 om 14 54 55 Scherm­afbeelding 2024-06-05 om 14 55 07

Seems to be mainly an issue on entities, not on devices or helpers. Although on those 2, the lag is also very noticeable compared to 2024.5

Inspector on local storage shows:

Scherm­afbeelding 2024-06-17 om 08 58 00 Scherm­afbeelding 2024-06-17 om 08 58 11
Mariusthvdb commented 3 weeks ago

if I click on an integration in the integration dashboard, I can see its entities after a very long wait:

Scherm­afbeelding 2024-06-05 om 15 00 41 Scherm­afbeelding 2024-06-05 om 15 01 13

going back to the ui, and revisiting the config/entities dashboard again after that 'remembers' those integration entities.... (which is very clumsy, because one doesnt go there for the preselection, but for the overview)

We need to clear the filter for Integrations, but, even then the preselected entities remain in sight:

Scherm­afbeelding 2024-06-05 om 15 03 20

the entities count shows the filters work, the entities list however remains as is

https://github.com/home-assistant/frontend/assets/33354141/c51812a6-6589-42e6-9b9c-e92178c234fb

Mariusthvdb commented 3 weeks ago

Ive just noticed that Collapse all on the Helpers dashboard does not collapse at all, I can only expand all

Scherm­afbeelding 2024-06-08 om 17 29 58

https://github.com/home-assistant/frontend/assets/33354141/ec86eb4b-0e03-4510-9c9b-d052b4adc3dc

Mariusthvdb commented 2 weeks ago

ok so current.ly running HA 2024.6.3, and I did discover something I hadn't tested before:

I can see all of my entities in the iOS companion app.

But, ONLY there. Any browser on the Desktop remains empty. Including the Mac Desktop app. I tested Chrome, Firefox, Edge and Safari, all in their current up to date versions.

RMMTSLLP commented 2 weeks ago

Hi I'm having exactly the same issues. Only seems to be with 1 out of the 2 installations I have. Has this been sorted yet? It's quite frustrating. Regards

Mariusthvdb commented 2 weeks ago

can you check which integrations/custom cards etc differ between the 2 installs?

and what size installs (number of entities) are you talking about?

RMMTSLLP commented 2 weeks ago

The two setups are really different the one that is working running the latest version 2024.6.3 has 592 entities and 15 integrations. The broken setup was working on version 2024.5.5 entities 2637 integrations 34. I'm just going through some more backups to see when the issue first occurred. I assume you still have this same problem, looking on the web not many of us have this issue.

Mariusthvdb commented 2 weeks ago

yep, currently investigating..... for me it was the beta of ha 2024.6 that directly introduced it

They did change something in the new filter engines of the entities dashboard, the data tables, which was widely announced, and to me, that is the only possible reason that stands out.

I havent changed anything in my custom cards during that period.

I could roll back to 2024.5 but fear the issues the setup (production) would suffer ....

Mariusthvdb commented 2 weeks ago

extra info:

I just restarted in Safe mode, and, after an initial improvement of seeing the entities populated (took more than a few seconds, so much slower than before), I am back to seeing nothing:

Scherm­afbeelding 2024-06-17 om 08 43 24

So, still in safe mode, after navigating to some other views and back again

RMMTSLLP commented 2 weeks ago

I can confirm all was well with;

Core 2024.5.5 Supervisor 2024.06.0 Operating System 12.3 Frontend 20240501.1

With this restored from backup file I see no issue with config/entities

I ugraded to ;

Core 2024.6.3 Supervisor 2024.06.0 Operating System 12.3 Frontend 20240610.1

The non display of config/entities returns. Sometimes the page does populate (Very rarely) also sometimes the page seems to lock up stopping me from navigating away to another page (Quite Often).

Is there anything you would like me to try before I install my latest backup so I can get back to a functioning system without "config/entities"

Mariusthvdb commented 2 weeks ago

glad I am not alone, that's all I can say... I reported during beta, but it was ignored unfortunately.

It would be useful if you could state wether or not you added custom cards/integrations between 2024.5 and 2024.6, to rule out any custom problem.

I believe to have proven with the Safe mode restart above that cant be the source of the issue at hand, but always better to positively identify.

The non display of config/entities returns. Sometimes the page does populate (Very rarely) also sometimes the page seems to lock up stopping me from navigating away to another page (Quite Often).

100% my experience. I briefly saw the entities list being populated in my Safe mode test, but quickly thereafter all were gone again, and the UI lag was all over.

Hope this will get some attention of the core Frontend devs soon.

RMMTSLLP commented 2 weeks ago

OK I tried running in safemode really no joy on my PC ....... however when running in safe mode if I use my S21 (Android) + Home Assistant App the config/entities seems to perform ok much more reliable on the PC very little delay less than 2 seconds

RMMTSLLP commented 2 weeks ago

https://github.com/home-assistant/frontend/assets/36048563/1928676e-ff05-434c-9300-8218f22501de

Hope this is it

Mariusthvdb commented 2 weeks ago

just downgraded to 2024.5.5 and see all entities like before... so definitely a HA 2024.6 thing

i had to update to 2024.6 though, because of the File integration migration....

I use my S21 (Android) + Home Assistant App the config/entities seems to perform ok

yes, as reported in the OP, my iOS companion app is showing the entities correctly. Only device though..

back on 2024.6 entities are gone again

RMMTSLLP commented 2 weeks ago

Sorry to eger and missed that bit.

Mariusthvdb commented 2 weeks ago

some new discovery:

with the Inspector local storage tab open, I noticed the earlier reported ha-filter-floor-areas being empty, and that made me think if it simply didnt cause a Non selection of all entities.....

so I tried to + a few areas, floor areas to be precise, and they were ticked and immediately un-ticked. I did notice the line in the right panel being edited with some of the entities belonging to the areas I selected.

Scherm­afbeelding 2024-06-17 om 14 45 00

what's more, I noticed entities being listed in the entities list! Finally!

Apparently we need to select floor areas for any entity to be listed. This can not be can it? I have a lot of areas in the house, which are grouped in floors (several floors per actual physical floor).

Wouldnt it be 'normal behavior' if one does not select a floor, that all floors are selected and the entities of those floors would be listed? ofc it would, just like in the Status filter. Select nothing, show all.

The Helpers view does work like that, why the different behavior?

another anomaly here is, that when adding a top level floor, none of the areas are auto ticked:

Scherm­afbeelding 2024-06-17 om 14 29 28

which makes it even more difficult to understand what is selected and what not.

besides that, the lag is now very visible, and understandable, if it actually adds all of these entities to the list in the local storage, and does so each and every time it changes.

causing this:

Scherm­afbeelding 2024-06-17 om 14 27 43

and making that non-manipulable. need to reload there to be able to get to the tick boxes again.

the fact this is a per browser setting, meaning if I have different panes open on the same machine (1 for editing, 1 for browsing, 1 for finding entities) and accidentally navigate in the wrong pane, I am in trouble all over....

@RMMTSLLP please check if you can confirm this?

RMMTSLLP commented 1 week ago

OK I've done some more testing and I think I can confirm what you are saying is correct. However I have to be in "safe mode to really make sense. I agree in config/helpers it defaults to display ALL helpers. You can then go on to search as required. In config/entities it defaults to show NO entity data. If you select an area (the tickbox briefly shows and dissappears) after a period entities for that area are displayed. When HA is NOT in "safe mode" I get no sense whatsoever. The screen freezes sometimes on a refresh it displays entity data, more often not. It certainly is not usable unlike config/helpers. bedroom.pdf

karwosts commented 1 week ago

I can make a guess of what is happening here, my guess is that your system may be just overloading the data table.

In frontend most components are updated every time the hass object updates, and that update is triggered anytime any entity on your system changes its state object.

With the entities data table, it seems that anytime that happens (any state changed), we attempt to re-sort and re-filter all the entities in the table. As the amount of entities in the system grows, the sorting time takes longer and longer. As the frequency of updates increases, the rate at which we are asked to sort and re-sort grows more and more frequent.

I suspect eventually this will hit some critical threshold where we are repeatedly asked to reupdate the sort order before we're able to finish sorting. I don't know what happens exactly in this case, but it seems like when this happen the system breaks down and it just appears to hang and become completely unresponsive. That may be why it seems to behave erratically, sometimes appearing to work for only a moment, and when it does work it is exhibiting very slow performance.

I can observe such by just creating an automation that toggles a boolean every 5ms. Anytime this automation is enabled, I cannot get my entities table to do anything, it just says "no data" until I disable the automation.

Maybe you can try running the performance profiler in your browser devtools, and see if its spending 100% time in the render/update process.

Mariusthvdb commented 1 week ago

Thanks for chiming in! we're desperate... ;-)

With the entities data table, it seems that anytime that happens (any state changed), we attempt to re-sort and re-filter all the entities in the table. As the amount of entities in the system grows, the sorting time takes longer and longer. As the frequency of updates increases, the rate at which we are asked to sort and re-sort grows more and more frequent.

could this be happening in 2024.6, and Not in 2024.5? Because thats when this started happening, 100% reproducible.

I can observe such by just creating an automation that toggles a boolean every 5ms. Anytime this automation is enabled, I cannot get my entities table to do anything, it just says "no data" until I disable the automation.

dont think there is such a heavy updating going on in my system, but I do have a few that are quite active... most of those are related to the power metering of the smart meter, and some templates based off of those.

that however has never bitten the Frontend in the least.

which makes me suggest this change to the data_tables is simply not up to par with modern requirements. and should be reverted really.

I mean, the fact that 2 posters here are suffering this, does not mean nobody else is. Seems highly unlikely given the exact same experience we notice.

Most users will probably never go to that view, so might never notice.

Maybe you can try running the performance profiler in your browser devtools, and see if its spending 100% time in the render/update process.

I'll do anything you want me to, but please be clear what exactly you need me to do. I can run profiler without issue, it's my main correspondence with BDraco ;-)

or are you looking for some other tab in Inspector?

btw, the fact this does Not happen on iOS companion app would seem to indicate this is not a system backend issue, but a Desktop Frontend issue? How else can my mobile phone show the entities without a sigh

karwosts commented 1 week ago

As far as I know what I'm describing is not a recent change, it's always been that way. If something changed in 2024.6 I have no idea what that could be.

Maybe something subtle changed that just pushed it over the edge.

Mariusthvdb commented 1 week ago

It was the announced change to the data tables probably https://www.home-assistant.io/blog/2024/06/05/release-20246/#data-tables-improvements

without those, in 2024.5 all was super smooth

unless ofc there would have been other backend changes that could cause heavy lifting.