thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.18k stars 111 forks source link

Filtering entities by label doesn't work #435

Closed adamlc closed 1 month ago

adamlc commented 3 months ago

I'm testing the new labels features and can't get auto entities to display anything for light entities, nothing is shown.

It does however seem to work for automation with labels!

Not tried any other entity types however.

Revilo91 commented 3 months ago

Same here

filippo196302 commented 3 months ago

Same here

Earthweb-EWS commented 3 months ago

I have the sane problem. No option are shown in UI dropdown and in code-editor it doesn't work also.

The code I using is this: filter: include:

RuneNyhuus commented 3 months ago

Same problem here... Not working with Labels

Mariusthvdb commented 3 months ago

as it should be a generic filter option, and not restricted to any domain, I added my +1, even though the title of the issue should probably be edited to reflect that generic pov?

Mariusthvdb commented 3 months ago

also, add a problem config ;-)

    - type: custom:auto-entities
      card:
        type: entities
        title: Test label auto entities
      filter:
        include:
          - label: intercom speler

remains empty,

Scherm­afbeelding 2024-04-05 om 15 54 48

even though:

Scherm­afbeelding 2024-04-05 om 15 09 04

tried several syntaxes if the 'intercom speler'....

and proof of the valid label on the entities in template editor:

Scherm­afbeelding 2024-04-05 om 15 57 08

and of the right version being installed:

Scherm­afbeelding 2024-04-05 om 16 02 44
Mariusthvdb commented 3 months ago

btw, I have it a few hard refreshes and now see this in the UI editor

Scherm­afbeelding 2024-04-05 om 16 09 28

the frontend is almost grinding to a halt though, so will give it the system a restart to see what's going on

update

can confirm the label filter to work as expected/documented.

However, the lag is still there, and it's not small (understatement)

maybe should open a separate issue for that (even though no errors are displayed in inspector)

boheme61 commented 3 months ago

However, the lag is still there, and it's not small (understatement)

Have you notice a significant CPU-Usage, after playing/adding these templates, we're playing with now ? I will try to remove the label-templates , and the "include"-label , in order, to see if i can "locate it"

Mariusthvdb commented 3 months ago

no, cpu nor memory have gone up, just a lag. a big lag.

meanwhile on 2024.4.1, and that hasn't changed anything in this regard. (not that it would have, but just saying the instance is up to date)

just established the lag is also happening on some of my other views, that dont have anything to do with the new label option, and just filter automations being triggered or not recently...

edit..... revisiting I just noticed this(far right of the graph) upon opening a test view wit only 2 label auto-entities entities cards:

Scherm­afbeelding 2024-04-09 om 10 35 45

Frontend hangs while trying to edit that view, or cards. There is a true bug here somewhere

using a template filter is fine:

card:
  type: entities
filter:
  template: |
    {{label_entities('Theater')}}

but using the label include makes the card drag the view down:

type: custom:auto-entities
card:
  type: entities
  title: Auto label
filter:
  include:
    - label: theater

or

type: custom:auto-entities
card:
  type: entities
  title: test filter label auto entities
filter:
  include:
    - label: intercom_speler
  exclude:
    - state: unavailable

the all show the correct entities, so the label include does work. sort of.

Mariusthvdb commented 2 months ago

let me open a separate issue for this, as the current title does not fit then issue anymore

TarkoonGithub commented 2 months ago

I have the issue that an auto entities card I created using a label as filter for the entities shows no entries when I use the companion app, but does show them, when I use a random web browser on the same smart phone or an any computer. v1.13.0 on HA 2024.4.3

Mariusthvdb commented 2 months ago

that would probably be a cache issue. the app can be obnoxious....

try to rest frontend cache in the app settings to force it to reload

TarkoonGithub commented 2 months ago

Already done, doesn't solve the issue.

EDIT: Cleared the frontend cache several times before, this time again when doing a reload of v1.13.0 of the card and now it works... Which way is the best to clear the cache? Always did it by reloading a random HACS item with clear cache dialog afterwards.

Mariusthvdb commented 2 months ago

go to companion app settings, error tracking, reset frontend cache

Mariusthvdb commented 1 month ago

@adamlc you still see this Not working? (and, I mean no entities are shown, not the horrible lag)

if you can see the entities being displayed, please close this, so we can focus on the lag the new option causes.

adamlc commented 1 month ago

Edit:

Yes it's working now! Thanks for the fix everyone :)

dnestico commented 1 month ago

I'm experiencing the same thing kind of except for me it doesn't even show "labels" in the dropdown and using it yaml doesn't work. I've cleared the cache 10 times, reloaded the page 10 times and even restarted home assistant and redownloaded auto-entities from HACS and still nothing.

EDIT: My console shows this but idk how that could be when I updated and redownloaded 5 times and also cleared the cache 10 times...

Screenshot 2024-05-19 at 12 06 58 AM