Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give example of how to add 'secondary_info' to each entity, when using template filters #475

Open
palves opened this issue Nov 21, 2024 · 0 comments

Comments

@palves
Copy link

palves commented Nov 21, 2024

AFAICT, the examples in the docs only cover adding options to entities when using the simpler filters. It took me way to long to figure out how to do it with templates, it's hard to find someone showing a working example. It would have been great to have it in the docs. Below is what I have, expanding an all_windows group which contains all my window sensors. I don't know if there's a simpler way. If there is, I'd of course be happy if it were shown in the examples instead.

type: custom:auto-entities
card:
  type: entities
  title: Windows
  state_color: true
sort:
  method: friendly_name
filter:
  template: |-
    {%- for entity in expand('binary_sensor.all_windows') -%}
      {{
        {
          'entity': entity.entity_id,
          'secondary_info': 'last-changed'
        }
      }},
    {%- endfor %}

(edit: doors -> windows, as it's more common for people to have multiple windows than multiple doors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant