lovelace-auto-entities: Filter template in version 1.16.1 breaks history-graph in 2025.6

Before update to 1.16.1 my card worked perfectly On 1.16.1 it only shows “Configuration error” and no messages in browser DevTools Console Chrome Version 137.0.7151.120 (Official Build) (64-bit) HAOS 15.2 Supervisor 2025.05.5 HA Core 2025.6.1

type: custom:auto-entities
card:
  title: Running
  type: history-graph
  hours_to_show: 24
filter:
  template: |-
    {% set STATES = states 
        | selectattr('entity_id', 'in', integration_entities('hassio')) -%}
    {%- for STATE in STATES -%}
      {%- if(STATE.entity_id.endswith('_running'))  -%}
        {%- set short_name = state_attr(STATE.entity_id, 'friendly_name')
             .replace('Home Assistant', '')
             .replace('& Web Terminal', '') -%}
        {{ { 'entity': STATE.entity_id, 
             'name': short_name } }},
      {%- endif -%}
    {%- endfor %}
  exclude:
    - name: Home Assistant Core*
    - name: Home Assistant Supervisor*
    - name: Home Assistant Operating System*
sort:
  method: name
layout_options:
  grid_columns: 8
  grid_rows: auto

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 62

Most upvoted comments

Is there another Issue on the History draw delay? Let’s continue this discussion there so as to not confuse the issue.

This is the code that generates the No state found error:


      - type: custom:auto-entities
        card:
          type: history-graph
          no_card: true
          hours_to_show: 24
        filter:
          template: >
            {%- set entities =
            state_attr('sensor.temperatures_buiten','entity_id') or [] -%}  {%-
            set ns=namespace(result=[]) -%} {%- for entity in entities -%}   {%-
            set ns.result = ns.result+[{'entity': entity}] -%} {%- endfor -%}  
            {{ ns.result }}        sort:
          method: state

The template looks up entities from a group sensor

Edit; it even works now. My sort was miss aligned, I can confirm you fixed it 🥳

Attached here - remove .txt

auto-entities.js.txt

AUTO-ENTITIES 1.16.1-dcapslock IS INSTALLED

you an use the experimental eval_js option (not documented) to assist

@dcapslock Thank you wery much! It works ) Hope eval_js will not be broken in future releases )

The issue with History Graph delayed in showing all data, is due to downsampling introduced in 2025.6. The downsampling routine takes in clientWidth of graph, which when hidden like in collapsable-cards, expander-card etc., is 0, so the downsampling ends up returning only a start and end point. Fingers crossed that a Frontend change can be made (don’t downsample if clientWidth is 0). In such a case the first display may be not 100% accurate as downsampling was introduced due to eCharts not working well with non-uniform X axis. However it would mean that the first display after being non-hidden would match prior 2025.6 and back to when eCharts was introduced.

I was using the iPhone companion app, and now closed the frontend cache, The config error displayed previously changed into this: image

type: custom:auto-entities
card:
  title: Auto-entities template tester
  type: history-graph
filter:
  template: >
    {{integration_entities('person')}}

perfect! also with type: map


I hoped this might also fix the other issue, using labels as filter, maybe somehow because the card is more efficient now, but alas, that is not the case…

Image

it is so grindingly slow, it cant even list the available labels… but that is an old issue, and another entirely apparently

@Mariusthvdb even with the Frontend change, auto-entities is still catering for those cards with a pretty ugly hack. I am proposing a much cleaner way to address. Already have a PR created - #558. You will see that there are 6 lines added and 45 removed. The old method needed updates if error messages changed. This method only needs cards updated that we wish to workaround, currently…

const CARDS_NO_ENTITY_WORKAROUND = [ "logbook", "map", "history-graph", "statistics-graph" ];

If anyone wants a JS file to test I can attach to a comment. Just let me know.

Maybe a coincidence, but the issues with these cards started with the introduction of the new get_statistics service

yeah, and its funny, because we can mitigate that struggling label issue

filter:
  include:
    - label: my_label

by including that as template filter.

filter:
  template: >
    {{label_entities('my_label')}}

and make it behave super fast.

you an use the experimental eval_js option (not documented) to assist.

type: custom:auto-entities card: title: Running type: history-graph hours_to_show: 24 filter: include: - options: eval_js: true name: ${ state.attributes.friendly_name.replace(‘Home Assistant’, ‘’).replace(‘& Web Terminal’,‘’) } integration: hassio entity_id: “*_running”

well that was truly undocumented 😉 in all these years…

for reference: https://github.com/thomasloven/lovelace-auto-entities/blob/360722dc512f6f3aea3bbfbe08553b06c37880b6/src/process_entity.ts#L22