Auto add entities based on wild card search (or device-class) and add filer option to exclude some of them
See original GitHub issueFinally, a battery card!
Any change your card can get a wild card for entities and attributes? And an exclude value option (some sensors like FIbaro can also be wired, the battery value is then defaulted to 4)
Cheers.
My cuurent setup:
card:
show_header_toggle: false
title: Sensor Battery Status
type: entities
filter:
exclude:
- state: '4'
include:
- entity_id: sensor.fib_*_battery_level
options:
style: |
:host {
--paper-item-icon-color:
{% if states(config.entity)|float <= 20 %}
red
{% elif states(config.entity)|float <= 35 %}
orange
{% else %}
var( ---state-icon-color )
{% endif %}
;
}
sort:
method: state
numeric: true
reverse: false
type: 'custom:auto-entities'
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Auto-entities - Automatically fill cards with entities
include: A list of filters specifying which entities to add to the card. exclude: A list of filters specifying which entities to remove...
Read more >Wildcard characters allow searching for patterns and variations
Expand search results to match any non-space character. The system supports both single-character and multiple-character wildcards.
Read more >Create and manage device groups - Microsoft Learn
Specify the matching rule that determines which device group belongs to the group based on the device name, domain, tags, and OS platform....
Read more >Manual Chapter: Adding Entities to a Security Policy - AskF5
The pure wildcard (*) is automatically added to the security policy so you do ... URL, and flow parameters as any value type,...
Read more >Solved: Re: Dashboard Wildcard Filtering ("not" Exceptions)
In the Dynatrace dashboard Data explorer is there a way to add wildcard exception filtering? Example, filter to show me all of something...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI @Tom-ahawk this card works with auto-entities. I’m using it right now like this:
So @maxwroc its up to you if you want to implement this yourself in your card or simply point people to auto-entities as a solution to this problem.
Interesing idea with the wildcard entity search! I’m slightly concerned it can be a bit slow if you have a lot of entities in your HA.
HA updates the cards “every time” (probably it is throttled) when any antity state changes (even if it’s not used in the card). So in this case I would need to iterate over the entire collection of entities and get their state. But since you’re saying that you have almost similar setup for the other card I will give it a try.
If it is ok perfwise I will add it in similar way as you have it in your example. If not I could do some kind of discovery mode in which list of found entities will be printed on the card - you would be able to copy it over to the configuration.
I don’t see any problems with state filtering so I will add it for sure