Comments (6)
You could wrap auto-entities in another auto-entities
type: custom:auto-entities
filter:
include:
- dynamic things
exclude:
- filter out dynamic things
card:
type: custom:auto-entities
filter:
include:
- things to always include
card:
type: entities
Haven't tested it, but I think this should work...
from lovelace-auto-entities.
Sorry for the delay getting back to you on this! I'm on holiday at the moment and have limited internet access.
I've tried this, but it wouldn't work for me:
- type: custom:auto-entities
show_empty: true
card:
type: entities
title: "Testing"
show_header_toggle: false
filter:
include:
- entity_id: light.office_light
- entity_id: light.landing_light
- entity_id: light.hall_lamp
- entity_id: light.outside_light
exclude:
- state: "off"
- state: "unavailable"
card:
type: custom:auto-entities
card:
type: entities
filter:
include:
- entity_id: light.desk_light
Also, I tried 'show_empty: true' in a normal auto-entities card (without wrapping multiple auto-entities) and it doesn't show the card until I turn on a light that's a listed entity.
Does that work OK for you?
from lovelace-auto-entities.
Take another look at that indentation, and the order of things.
You can also try the new not:
filter.
filter:
include:
- entity_id: light.always_show_me
- entity_id: light.show_me_sometimes
not:
- state: "off"
state 2: "unavailable"
from lovelace-auto-entities.
I have a variant of this, where I want to sort a group, but then have certain entities pulled to the front. I do this by specifying those entities first, and then including the group, and finally setting the unique
option.
But something else ocured to me along the way;
I wonder if it would make sense to add a filterset
filter, which nests all the options relevant to building the final entities list. The rationale:
- For the case of ensuring some items; the base filter set would include the entities you want to always show, and any overall sort order, and then a
filterset
with the regular stuff, with it's includes and excludes lists. You'd then merge the nested entities list back into the main list, omitting duplicates against the two already added, and finally sorting if desired. - For my case using this option, I'd include the two entities I want just the same, but then include a filterset with the group included, and a sort option. The result being the group nicely sorted, but after being folded back into the enclosing list, those specific items would now be "pulled to the front".
From a brief look at the code, it doesn't look like it'd take much to do that. The function that builds the entities list would take a config as parameter (the main card config itself in the base case), then when it hits a filterset
filter, call itself recursively with that filters config, and finally merge the result back in as per regular group filters. The computed entities list would be returned, which the base case would then take as the cards final entities list.
from lovelace-auto-entities.
Take another look at that indentation, and the order of things.
You can also try the newnot:
filter.filter: include: - entity_id: light.always_show_me - entity_id: light.show_me_sometimes not: - state: "off" state 2: "unavailable"
I've looked at the indentation, tried more variations etc. but still can't get it to work.
Not to worry, thanks anyway for trying.
from lovelace-auto-entities.
I've looked at the indentation, tried more variations etc. but still can't get it to work.
While the example I gave you was not correct (edited now), I think you could find the problem if we look at this together.
- type: custom:auto-entities # auto-entities starts here | show_empty: true | card: # card settings start here | | type: entities | | title: "Testing" | | show_header_toggle: false | # card settings end here | filter: # filters start here | | include: # filters -> include starts here | | | - entity_id: light.office_light | | | - entity_id: light.landing_light | | | - entity_id: light.hall_lamp | | | - entity_id: light.outside_light | | # filter -> include ends here | | exclude: # filter -> exclude starts here | | | - state: "off" | | | - state: "unavailable" | | # filter -> exclude ends here | | card: # filter -> card (what?) starts here | | | type: custom:auto-entities | | | card: # etc... | | | | type: entities | | | filter: | | | | include: | | | | | - entity_id: light.desk_light | | # filter -> card (???) ends here | # filter settings end here # auto-entities ends here
from lovelace-auto-entities.
Related Issues (20)
- "Integration" filter: not all entities are listed (possibly only entities with unique_ids)
- Question: Is it possible to display the top consuming entities? HOT 2
- Using a device filter slows down a performance HOT 9
- Feature request: Title HOT 2
- Filtering Zones not Pulling All Zones
- How can I list all areas? HOT 1
- Use custom:template-entity-row possible? HOT 1
- Visual editor not working HOT 1
- 'options: tap_action: action: toggle' doesnt work HOT 1
- [FEATURE REQUEST] - ability to customize (display) 'name' property of entity HOT 2
- Is it possible to create buttons? HOT 1
- Feature: Alternative text if no entities were found
- [Question] - Possibility to customize icons for each items in list
- [feature request] transformation of visible names for entities HOT 1
- Enhancement: Sum of State HOT 2
- Cannot use quotes for string in Attributes: HOT 1
- Cards not "reserving" space before layout get generated
- Error when using with "Hue like card" HOT 3
- How to install if used in yaml-dashboard with docker? HOT 1
- How to use and: / or: HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lovelace-auto-entities.