Skip to content
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

Using two filters throws an error... #463

Open
samedarkclouds opened this issue Sep 13, 2024 · 2 comments
Open

Using two filters throws an error... #463

samedarkclouds opened this issue Sep 13, 2024 · 2 comments

Comments

@samedarkclouds
Copy link

samedarkclouds commented Sep 13, 2024

I labeled my devices by function (i.e. "Shade"") Some things that are labeled "Shade" are also "Group" because they are a group of shades.

If I want the shades that are only group I would

filter:
 include:
    - label: 'shade'
      label: 'group'

But this throws a "duplicate key mapping."

Using "and, or, not" doesn't seem to work either. It does not throw an error, it just retunes no results:

filter:
  include:
    - label: 'shade'
      and:
        label: 'group'

So, this using labels to drill down in filters (my only real reason for them) pretty useless without making a bunch of accommodations that makes the whole point of labels pretty moot. Example, labeling ever single entities thats not in a group "not group" and putting it in exclude, but that means I need 20 not group labels because there is one group in the domain.

So, could you please consider making the and/or/not functions allow the duplicating Label Key? This would make the world a much better place!

Thanks.... Love your stuff.

@AlexLab
Copy link

AlexLab commented Sep 16, 2024

Hey! sry if i missunderstand but i too tried to use 2 filters and it didn´t work, so i found this and tried a few things. These to options here:

filter: 
include:
    - integration: zha
      and:
        state: 'unavailable'

or

filter:
 include:
    - integration: zha      
       state: 'unavailable

Didnt work for me either - no results or an error, but this worked:

    - integration: zha
      and:
        - state: 'unavailable'

This was also the only way combining 2 filters worked for me and not just seperatly filter all entities for filter 1 and then for filter 2.

@teskanoo
Copy link

teskanoo commented Oct 4, 2024

None of the examples here represent the syntax detailed in the readme.

https://github.com/thomasloven/lovelace-auto-entities?tab=readme-ov-file#repeating-options

The answer for the original poster is

filter:
 include:
    - label 1: 'shade'
      label 3: 'group'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants