This is the code I am using, true is that the line in the template check in HA doesnāt seem to return not an error nor the expected result, so, not sure if itās me or what
@Maaniac code aswell does the same in the template test to be fair
I also tried the same with the mini-graph-card using @Maaniac icon config, still got a configuration error:
your first one isnāt defining templates correctly ${}. Also, youāll need to template the full line, not just parts of it. The full thing is evaluated as Javascript code.
on your 2nd one, youāll need to convert the string to a number to evaluate most likely
Thank you for your contribution! If I understand this thing correctly, itās a card that allows you to template other cards. In effect, it overrides other cards and gives them templating abilities with access to the hass object.
If my interpretation is correct, it makes me wonder why templating isnāt a common ability of all cards. It seems one often finds a need to tweak a cardās appearance, or even conditional visibility, in a way that the cardās author never envisioned. Maybe templating should be part of Lovelaceās DNA, an inheritable trait in order to make it easily available to existing stock, custom, and future cards.
Of course, I offer this opinion with little knowledge of Lovelaceās innards so I might just be asking for the impossible.
Curious thing, not ure if anyhow related.
On the temperature issue, I got an error in the browser console:
at HTMLElement.setConfig (config-template-card.js?track=true:2290)
at create_card_element_createElement (401352253e833b70a294.chunk.js:4823)
at createCardElement (401352253e833b70a294.chunk.js:4823)
at HTMLElement._createCardElement (401352253e833b70a294.chunk.js:3618)
at _cards.config.cards.map.card (401352253e833b70a294.chunk.js:3615)
at Array.map (<anonymous>)
at HTMLElement.setConfig (401352253e833b70a294.chunk.js:3615)
at create_card_element_createElement (401352253e833b70a294.chunk.js:4823)
at createCardElement (401352253e833b70a294.chunk.js:4823)
at HTMLElement._createCardElement (401352253e833b70a294.chunk.js:3618)
On the second one (charging/not charging) I donāt get any error in the console.
Lovelace core will not support templating, that has been stated from the beginning by balloob, but this should cover all use cases, I believe where templating could be beneficial. I think
You can only do what the card supports. entities card does not support icon_color.
As noted in the readme, you need to use the full name of cards, i.e. custom:hui-entities-card
Edit: I COULD drop the custom requirementā¦but not sure if I should or not. Seems to fit better with what is done by core already , but Iām not going to maintain a list of what cards/rows/elements are in core, so the full name will be required regardless
It was in the readme, below the example, just not the example itself. And since apparently asking for people to update Readme is rude, I did it myself just nowā¦