thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.27k stars 116 forks source link

Template variant (one-liner) from documentation examples not working #304

Closed bcutter closed 1 year ago

bcutter commented 2 years ago

Regarding https://github.com/thomasloven/lovelace-auto-entities#examples:

✔ While this is working... grafik

❌ ...this one... grafik

...gives:

grafik

That is pretty sad as I have a template (all my templates) written in that style.

System information:

Please note that thes are working too:

type: custom:auto-entities
card:
  type: entities
  title: Beleuchtung Test
filter:
  template: |
    {{
      expand(states.light)
      |selectattr('state', 'eq', 'on')
      |map(attribute='entity_id')
      |join(',')
    }}

type: custom:auto-entities
card:
  type: entities
  title: Beleuchtung Test
filter:
  template: >-
    {{states.light | selectattr('state', '==', 'on') |
    map(attribute='entity_id') | join(',')}}

To summarize: Using | list filter is working well in dev-tools template section, in template sensors and everywhere else - but not in auto-entities. A | map(attribute='entity_id') | join(',') filter instead works well.

Maybe that example is just outdated as it was working some time ago?

bcutter commented 2 years ago

Great. Should have searched few minutes longer.

Realized I went through the same process like the user here at https://github.com/thomasloven/lovelace-auto-entities/issues/290

That is from June 15th 2022. If that "bug" on the example section would have been fixed three months ago, others wouldn't need to walk into that dead-end road too.

@thomasloven thanks for fixing your docs.

thomasloven commented 1 year ago

Fixed by #298?

bcutter commented 1 year ago

Yes, fixed.

I like and appreciate your years end motivation of going through all (plenty) of open issues of your great projects. Thank you! Continue the good work and have a good start in 2023 😃