lovelace-auto-entities
lovelace-auto-entities copied to clipboard
Allow arbitrary placement of entity details
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 #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