thomasloven / lovelace-auto-entities

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

Not support templating to change attributes of the entity? #368

Open ceinmart opened 1 year ago

ceinmart commented 1 year ago

Hi,

I'm trying to adjust the name of the entities using templating, however, appears the jinja code wasn't interpreted, they show the code. I'm missing something here or is this resource not supported?

That is what happens: image

Here is the code:

type: custom:stack-in-card
cards:
  - type: custom:auto-entities
    card:
      type: custom:layout-card
      cards: []
      layout_type: custom:grid-layout
      layout:
        grid-template-columns: auto auto auto auto
        margin: '-4px -4px -8px -4px;'
    sort:
      method: friendly_name
    filter:
      include:
        - entity_id: '*temp*'
          domain: sensor
          area: /sala|suite|escri/
          options:
            type: custom:mushroom-entity-card
            layout: vertical
            name: |-
              {% if 'sala' in this.entity_id %}
                Sala
              {% elif 'broad' in this.entity_id %}
                Escritorio
              {% elif 'suite' in this.entity_id %}
                Suite
              {% endif %}
            secondary_info: null
            card_mod:
              style: |
                ha-card {
                  background: none;
                  padding: 4px 16px !important;
                  --ha-card-box-shadow: 0px;
                  border-style: none;
                }
view_layout:
  grid-area: cab
ildar170975 commented 1 year ago

You posted a code with FOUR additional plugins unrelated to the currently observed auto-entities. One of the SW development rules is "simplify in case of issues".