šŸ”¹ Auto-entities - Automatically fill cards with entities

Then try using template option:

  • list al devices
  • check if a device belongs to the area
  • for each found device - list all entities sorted by entity_id

But I have never tried to list devices. Even not sure if it is possible))

I was thinking the exact same thing, use a template, anything s possible especially with the new template extensions in Ha.

start with this:

{% for d in area_devices('Attic') %}
{{device_attr(d,'name')}}{{device_entities(d)}}
{% endfor %}

and see if it can be auto filled based in the filter area?
Might not be doable after all, because this template wont show, and I dont think we can add ā€˜for all Areasā€™ in the templateā€¦

I seem to recall auto-entities supports those now, but maybe only in filters and not yet sort?

Btw be sure to check out GitHub - marcelveldt/hass-area-views: Automatic Lovelace view generator for your Home Assistant Area's if you want a nice area dashboard :wink:

Hi,

is there a way to get access to other attributes like area in the option section? I have access to this.entity_id but I need something like this.area.

Thanks!

Access to state objects supported in the template option only.

1 Like

Is it possible to use custom cards with the auto-entities?

i.e.

type: custom:auto-entities
card:
  type: custom:simple-thermostat
  state_color: true
filter:
  include:
    - entity_id: climate.*
  exclude: []

I canā€™t get it working but wondered whether it is possible.

Suppose you have a card which accepts a list of objects:

type: some-card
some_objects:
  - entity: sensor.XXXXXXX
    ....
  - entity: sensor.XXXXXXX
    ....

Examples - Entities card, Glance-card, history-graph, custom:mini-graph-card, custom:apexcharts-card, ā€¦
If you want to fill the some_objects list by auto-entities:

type: custom:auto-entities
card:
  type: some-card   ### your card
card_param: some_objects   ## by default = "entities"
filter:
  include:
    - ...
      options:
        .... options for a particular entity

As for your case - check if the custom:simple-thermostat accepts a list of objects.

If not - then your way is using that card inside a STACK:

type: custom:auto-entities
card:
  type: vertical-stack
card_param: cards
filter:
  include:
    - ...
      options:
        type: some-card   ### your card
        .... options for a particular card
1 Like

I noticed that this card currently includes entities that are hidden using the new 2022.4 functionality. Is there an easy filter to exclude those? As the card is intended for the UI I feel like these should not be included by default.

As far as I know, there is no ā€œhiddenā€ attribute among the state objects.
And we cannot use the ā€œhiddenā€ attribute inside a ā€œtemplateā€ option, for instance.

I hid this entity:

There is a ā€œhidden_byā€ attribute in core.entity_registry:
image

But I cannot check if it is hidden:

From my point of view, currently this ā€œhidden thingā€ works only for auto-generated dashboards (is anyone using them???)

I have one autogenerated dashbord to easily get at entities I did not care to include in my ā€œnormalā€ dashboards, which of course I maintain myself. But this card is the perfect balance between control of the dashboard and not having to maintain a lot of entity lists by hand. That is why I hope to find a way to hide unwanted entities.

For instance, when using the Switch as X feature, the original entities should not show up as well. The same goes for a lot of other template entities I use to enhance the original ones. I use template covers that block normal operation when it isnā€™t safe (wind, open window blocking a rollerblind). I hide the original unprotected ones now. It would be nice if I can take advantage of that with the auto-entities card.

I could list them as excludes, but that kind of defeats the purpose, as Iā€™d then be listing the other half.

1 Like

As I said, this ā€œhiding thingā€ is not available in ā€œstate objectsā€. But probably this ā€œhiding thingā€ is available for custom cards via some programming interface - I do not know.
You may start monitoring this issue:

1 Like

Is anyone able to configure filters through the GUI editor? Iā€™m running into this issue that I just reported but Iā€™m curious if others are seeing issues or if itā€™s just me: Cannot configure filters in visual editor Ā· Issue #282 Ā· thomasloven/lovelace-auto-entities Ā· GitHub

Sorry for the late reply @Ildar_Gabdullin and @Mariusthvdb ,

I will try templating. As this is relatively new to me, I will need to do this during the weekend.

But something else I ran into last night:
I would like to use auto-entities within cards like horizontal stack, grid and picture-elements. But of course, when I have a lot of entities, then the auto-entities creates one long list.

Is it possible to somehow break this list into sections or make it create columns?

One idea would be to only display entites 1-10, then 11-20 and so on. So a filter which is not based on the entity information but only on the amount of entities returned?

1 Like

Thank you! Sometimes I am sooooo stupid ^^

For some reason, when I looked at sort, I took as meaning the very first one within the filter and not that I can define the number for the first one.

Duuuuuhhhhh :smiley:

So am I, welcome to the club :laughing:

1 Like

This may sound like a weird idea, but would it be possible to use auto-entities based on e.g. dashboard name?

So
something along the lines of

  • entities: sensor.* + #code that looks for e.g. living_room in the dashboad name

By the way, does anybody know why it is not possible to start and entity with * ?
So, why does

  • entities: *living_room
    not work but
  • entities: sensor.*living_room
    does work?

I donā€™t have an answer to your first question, unfortunately.

But when it comes to the use of * there are examples in the docs that show that you should use quotes, so "*living_room" should work.

1 Like

OK group or @thomasloven ā€¦ I am a bit lost on this one and I am trying to figure out whether this can be done.

Background ā€“ because of the demise of Insteon, I have been doing some GUI work to make things easier. As part of this, I created a sensor that can give me entity_idā€™s for all insteon devices and then I put them into an option list. Selecting an option list I can get the currently selected entity. Now because the auto-entities card only takes templates in the ā€œtemplateā€ of filter, I pass in that via jinja.

But I would have expected the ā€œauto-entitiesā€ card to toggle auto-magiclly to the type selected or even by setting the type to ā€œslider-entity-rowā€ ā€¦ instead it seems to only use a switch with on/off.

To explain further, look at this illustration:

Clearly the device is a dimmable entity, yet it does not show a slider for the dim setting.
Yet if I simple have the same entity in a card:

Maybe I need to add domain light? or?

In other words, does a the template filter actually control entities or? It seems like no matter what I do, I only see on/off

long time issue, I never got around to ask/post:
whenever I use auto-entities and add an entity in the entities list like:

  - type: custom:auto-entities
    card:
      type: entities
      title: Update entities
      entities:
        - sensor.hacs
    show_empty: false
    filter:
      include:
        - domain: update
          state: 'on'

the filters are applied correctly, or at all I should say. I only see the entity sensor.hacs.
Itā€™s not until I do

  - type: custom:auto-entities
    card:
      type: entities
      title: Update entities
      card_mod:
        class: class-header-margin
#      entities:
#        - sensor.hacs
    show_empty: false
    filter:
      include:
        - domain: update
          state: 'on'

I get to see the on entities of the domain update.

But, I want to see both, so am forced to do:

  - type: entities
    title: Updates available
    entities:
      - sensor.hacs
      - type: custom:auto-entities
        card:
          type: entities
          card_mod:
            style: |
              ha-card {
                box-shadow: none;
                margin: -16px;
              }
        show_empty: false
        filter:
          include:
            - domain: update
              state: 'on'

to get:

anyone seeing an obvious mistake in my top config, or do I file an issue report on a bug discoveredā€¦

btw, using an unindented entities section like:

  - type: custom:auto-entities
    card:
      type: entities
      title: Update entities
      card_mod:
        class: class-header-margin
    entities:
      - sensor.hacs
    show_empty: false
    filter:
      include:
        - domain: update
          state: 'on'

shows the sensor.hacs, but as a last item the list:

thanks for having a look!

Your last version (with it unindented) looks the most correct to me, or at least it works for me.

But what happens if you add a sort by name method? Does it put the HACS sensor first in this case?

The reason I ask is that it maybe working for me because the entity Iā€™m including always alphabetically precedes the filtered entities, so I wonā€™t have noticed it not working. In that case, it does sound like a bug.