I’m attempting to setup a glance card that will show entities when certain conditions exist since it doesnt make sense to have it showing when it’s docked for the other 165 hours a week it’s not cleaning.
For example, I want the status and last cleaning end time entities to always show, but the battery level only when it’s under 100% and the progress meter when it’s above 0%. I’ve found where I can do similar with a conditional card, but that seems to be the whole card and I’d like to do it with just the entities. Is there a way to do this with Glance, or a different type of card I’m just not aware of?
That is giving me a incorrect filter config. Took a look through the linked documentation (Thank you!) and that doesnt seem to help. I rearranged the entity order so that the persistent entities are the top two, but the other two I want to show up only when the number is <100 and the above isnt letting it happen. New to yaml; my dayjob is in powershell so sorry for the neediness
Incorrect filter config;sorry. Legit all it says. If I put yours in verbatim, it gives me the same. It definitely appears to follow syntax based on the link you provided but it definitely doesn’t like something with the filter it appears. I have the below half working but it’s applying the filter to every entity instead of targeting a specific entity. Is it possible to apply the state filter to a specific entity?
This is giving me the below. Problem being that it hides the battery (because the battery is charged) but there’s no reason to show cleaning progress unless the cleaning is in progress (above 0). Being able to target each entity would fix this.
You can apply unique filters to each entity, but the card also expects a list of global state filters or conditions as well, which you can just define as an empty list. Missed that part.
Thanks for the help! Home Assistant via ChatGPT isnt giving me much to work off either. It actually thinks it cannot be done with the entity-filter…
You’re right—state_filter only supports string matches directly, and doesn’t support numeric comparisons like <10. To apply more complex logic like numeric comparison, we need to use a template condition instead.
Unfortunately, the entity-filter card does not support full templating like Jinja2. However, we can use the newer conditional card as a workaround when we need more advanced display logic.
Here’s how you can achieve the desired behavior using a combination of conditional cards inside a horizontal-stack (to mimic a glance card)
Entity-filter requires one global filter, either state-filter or conditions. State-filter is the legacy but I’ll use that as that’s what I’m familiar with.
In additon to that, you can set state-filter on any individual entity and that will replace the global defined state-filter.
So if you have some entities you want to always show, just make a dummy global state filter, I chose state != "".
Then on individual entities, you can define whatever custom filtering logic you want. Here’s a full example.