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

anyone else noticing small gaps surrounding an auto-entities config like these all of a sudden: https://github.com/thomasloven/lovelace-auto-entities/issues/173

only thing changed is HA, and auto-entities :wink:

The following code worked perfectly ok until upgrade to 1.8.2 It kills the lovelace page containing this code. Removing it restores the remainder of the page. Any guidance to point me to the necessary correction would be appreciated:

card:
  title: GAD
  type: entities
entities:
  - entities:
      - entity: input_boolean.notify_utility
      - entity: input_datetime.gad_notification_time
    head:
      label: Notification Settings
      type: section
    padding: 0
    type: 'custom:fold-entity-row'
filter:
  include:
    - entity_id: sensor.gad_restafval
    - entity_id: sensor.gad_gft
    - entity_id: sensor.gad_papier
    - entity_id: sensor.gad_pmd
    - entity_td: sensor.gad_textiel
show_empty: false
show_header_toggle: false
sort:
  attribute: Sort-date
  method: attribute
  numeric: true
title: GAD
type: 'custom:auto-entities'

As a lot of other users, Iā€™m using some Shelly devices for my home automation.

When debugging, flashing firmware or no matter what, Iā€™m using the Shelly built-in web interface. Mainly because itā€™s user friendly and it offers more options than the app.

For now, Iā€™ve been using a static entities-card to reach the devices (all static IP adresses):

entities:
  - icon: 'mdi:power-plug-outline'
    name: Smart Plug Boiler
    type: weblink
    url: 'http://192.168.68.xxx/'
 ...etc...

Although it works fine, it stillā€¦wellā€¦static and all Shelly devices publish their IP-adress on MQTT, so it is stored in sensor.shelly_xxx_ip

Building a list is fairly simple and works perfectly:

type: 'custom:auto-entities'
card:
  type: entities
title: Smartplugs
filter:
  include:
    - entity_id: sensor.shelly*ip

But its still just an entities-card, so not clickable.

Iā€™ve been trying with custom:template-entity-row but no success.

Option 1: make all entities weblinks, but how to get the entity value in the url-field? Iā€™ve found that this field is not template-able. The entity sensor.shelly*ip just has a state (the IP adress) and a friendly_name attribute.

type: 'custom:auto-entities'
card:
  type: entities
title: Network
filter:
  include:
    - entity_id: sensor.shelly*ip
      options:
        type: weblink
        url: ???

Option 2: use custom:template-entity-row and set the tap-action but same problem here. This is also not useable for option one because you would get 2 type definitions.

type: 'custom:auto-entities'
card:
  type: entities
title: Network
filter:
  include:
    - entity_id: sensor.shelly*ip
      options:
        type: 'custom:template-entity-row'
        tap_action:
          action: url
          url_path: ???

Any suggestions from the community?

I just started playing with this card and itā€™s not behaving as Iā€™d expect. In my case, Iā€™m using it for to display info about my 3D printer. Thereā€™s a printer error sensor that is ā€œOffā€ if no error is present. Thatā€™s really the only entity I care about hiding, so Iā€™m attempting to filter and exclude sensors in state ā€œOff.ā€

type: 'custom:auto-entities'
card:
  type: entities
  entities:
    - entity: binary_sensor.ender_3_project_printing_error
      name: Print Error
      secondary_info: last-updated
    - entity: sensor.ender_3_project_job_percentage
      name: Print Completion
      icon: 'mdi:file-percent-outline'
    - entity: sensor.octoprint_time_elapsed_format
      icon: 'mdi:clock-start'
      name: Printing Time Elapsed
    - entity: sensor.octoprint_time_remaining_format
      name: Printing Time Remaining
      icon: 'mdi:clock-end'
filter:
  exclude:
    - state: "Off"

Auto-Entities

Iā€™ve gone into Developer Tools and checked the state just to be sureā€¦ and it is, in fact, ā€œOff.ā€

Do I have a syntax problem in my card somewhere?

type: custom:auto-entities
entities:
 - LIST 1
filter:
  include:
    - LIST 2
  exclude:
    - LIST 3
card:
  CARD_OPTIONS

auto-entities takes LIST 1, adds LIST 2 and removes LIST 3.
Then it adds this to CARD_OPTIONS, and thatā€™s what youā€™ll get in your card.

Thanks for your reply, but is that not what Iā€™ve done in my auto-entity card above?

Are we able to filter using time and date?
I want to be able to only show the current sensor, for this sensor, thanks

After some of the latest updates this code does not work as a separate card:

        type: 'custom:auto-entities'
        card:
          type: entities
          title: auto-entities (sort name global)
        entities:
          - entity: sensor.ac68u_devices_connected
            name: ŠŸŠ¾Š“ŠŗŠ»ŃŽŃ‡ŠµŠ½Š¾ устрŠ¾Š¹ŃŃ‚Š²
            secondary_info: last-changed
          - type: section
        filter:
          include:
            - domain: device_tracker
              attributes:
                source_type: router
              options:
                secondary_info: last-changed
        unique: true
        sort:
          method: name
          reverse: false
          ignore_case: true

Moreover - it forces some other cards to disappear.
How to reproduce:

  1. Open any view.
  2. Add a new card. Open code editor and add that code. Save.
  3. The added card is not displayed.
  4. Open raw editor.
  5. Find the added card and move it between cards located on this view. Save.
  6. Open the view - all cards located after the added card not displayed.

Yes, I have the same issue when using mini-graph inside auto-entities. Somehow everything on the page inside the same layout-card is gone. Happens on all my pages where mini-graph is present. Other pages work fine. On 1.7.0 all works. I hope itā€™s fixable.

Thereā€™s a bug in auto-entities which can cause this. Iā€™m working on it right now.

Does anyone have problems with disappearing cards that are not in layout-card or vertical-stack-in-card?

1 Like

not disappearing, but appearing gaps around the auto-entities card (in stack-in-card): šŸ”¹ Auto-entities - Automatically fill cards with entities
using the hui-element card on the auto-entities card fixes that for now.

Here 3 cards:

  • auto-entities
  • entity card
  • entities card
    The last 2 are not displayed too.
  - title: zzzzzzzzz
    path: zzzzzzzzz
    badges: []
    cards:
      - type: 'custom:auto-entities'
        card:
          type: entities
          title: auto-entities
        entities:
          - entity: sun.sun
            secondary_info: last-changed
          - type: section
        filter:
          include:
            - domain: device_tracker
              options:
                secondary_info: last-changed
        unique: true
        sort:
          method: name
          reverse: false
          ignore_case: true
      - type: entity
        entity: sun.sun
      - type: entities
        entities:
          - sun.sun
          - sun.sun

This should be fixed in 1.8.3

1 Like

Thomas, thank you! Now it works, I do not see the problem.

fwiw, šŸ”¹ Auto-entities - Automatically fill cards with entities is still happening.

Fwiw @Mariusthvdb this has been happening as long as I can remember with conditional cards in vertical stacks too.

conditional cards do tend to take spaces, even as separate cardsā€¦

my issue above however is new since this week, and I believe it to coincide with the many updates of auto-entities. I didnt notice it after updating Ha itself to either of the 2021.3 versions (but might be wrong there, just didnt notice it)

Nothing else in that card config changed. thereā€™s an older post of mine here too show the gapless way it was before:

This problem still exist since 1.8.2 and did not resolve with 1.8.3

Canā€™t reproduce with 1.8.3. What does your browser console say?

Your issue sounds like what my issue was. For me 1.8.3 has fixed it. Make sure you clear caches and reload page a few times. Sometimes it can get stuck to older version in the browser, even after multiple reloads. Closing other browsers can help. Or uninstall card, delete from resources, reboot HA, install again and add as resource, restart HA again and then reload browser.

Make sure it says this in your browser console, keep trying till it does and then test it.
msedge_hYnfiwXbEi