thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

history-graph - name template not working #98

Closed chadbaldwin closed 1 year ago

chadbaldwin commented 1 year ago

I've gone through the docs for auto-entities, history-graph and template-entity-row...but I can't seem to figure out where I've gone wrong.

I'm trying to use template-entity-row to set a custom name: property within a history-graph which is populated using auto-entities.

I have plenty of other cards that combine auto-entities and template-entity-row to set custom names and they all work great. But for some reason, specific to history-graph, it is not working.

"Not working" in this case means, the templates are being rendered literally. So if I set name: "{{ 'abc' }}", then the resulting name is {{ 'abc' }} literally.

Here is an example script:

type: custom:auto-entities
card:
  type: history-graph
  refresh_interval: 5
  hours_to_show: 6
filter:
  include:
    - entity_id: /^switch\.outlet_\d\d_switch$/
      options:
        type: custom:template-entity-row
        name: "{{ 'abc' }}"

The result is this:

image

I don't see any issues with my configuration, so my best guess is that this is either a bug, or history-graph is just not supported by template-entity-row.

chadbaldwin commented 1 year ago

Sorry...I'm just dumb. RTFM.

Literally the first line of the readme of this repo "Display whatever you want in an entities card row"

Womp womp. I was really hoping I'd be able to use this in other cards.

ildar170975 commented 1 year ago

I was stunned for a moment when saw using a custom card inside history-graph )))) You may close the issue )

chadbaldwin commented 1 year ago

Maybe I'll fork this and see if there's a way to make it work for history-graph...or even making it work for ANY card (I have no idea how the HA UI works). Would be nice to have the ability to use custom templates to set names for any card.

Until then...closing issue 😢

thomasloven commented 1 year ago

Literally the first line of the readme of this repo "Display whatever you want in an entities card row"

You have just restored a bit of my faith in humanity. Thank you.


See this if you don't get why...