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

Allow arbitrary placement of entity details #459

Open
igorsantos07 opened this issue Aug 5, 2024 · 0 comments
Open

Allow arbitrary placement of entity details #459

igorsantos07 opened this issue Aug 5, 2024 · 0 comments

Comments

@igorsantos07
Copy link

The README exposes a simple example on how to use auto-entities to create a grid with standalone entity cards, which is an awesome starter point.

However, if you want to use different cards, you're stuck to anything that can receive the entity: prop. The only way to use, for instance, a decluttering-card template is to use the double-auto-entities hack where one of the filters is a template that returns a dict with the details you need for the card...... Which is (1) ugly AF, (2) terrible to write and debug, (3) very confusing and (4) not performant at all.

A suggestion would be to do it like this:

filter:
  include:
    - entity_id: "sensor.*_battery"
      options:
        type: custom:decluttering-card
        template: my_graph_template
        variables:
          - entity: "[[entity_id]]"
          - title: "[[friendly_name]]"

Bonus points:

  • any chance this idea could be jinja-templated? This would effectively allow people to do their own replacement rules, killing off the dreaded FR: bulk rename option #166
  • another option is try to follow what was done in custom-ui, which allows us to write basic JS to achieve some value manipulation
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