I tried it yesterday and I saw in the dev tools states page that it changed the actual state there.
here it is without the entity being templated (it’s the “binary_sensor.nuc_memory_usage_high” entity):
and here it is after the templated config using the code from above You can see that it’s the same as the memory percent used sensor:
You won’t see the state change in the dev-tools states page until you have the templating code active in lovelace and then you need to restart HA. Then it shows the updated state.
But you can see the result of the template on the actual state because the entity-filter card (which is filtering for the “on” state) isn’t displaying the entity because the actual state is no longer “on”; it’s now “73.9%”.
I’ve done some testing using a copy of the hass object, rather than the original and, unfortunately, I don’t think this will actually be possible. The most I’ve been able to do is make it so templating the state of an entity doesn’t interfere with other cards on the page and doesn’t affect the Developer Tools/States page (and I’ll release a filx for this shortly). However, the issue with cards such as entity-filter is that it isn’t possible for the card-templater card to pass the templated states to the card without it also affecting the filtering (as everything is using the hass object passed to it).
I’ll have to see if I can figure out another way to do it. Or not… It’s not really something necessary. Just something I thought would be nice to have so I can see the actual number on that sensor instead of navigating to another page to see it.
Do you know of another custom component that allows us to template the displayed state of an entity?
I think you’ve posted this in the wrong thread, this is for the card-templater card which allows you to use Jinja2 templates. I think you need to post this here:
Would it be possible to use this card to make weblink?
In my example below i want a card with 2 collumns:
First the state of my sensor “sensor.spel_game_01” then the state of “sensor.spel_titel_01” that should be an clickable url from the state of the sensor “sensor.spel_url_01”
This card only allows the configuration of the card or the states of the entities to be templated. Unless the card you are templating allows the state to be displayed as a link (I’m not sure what card you are trying to use there, since weblink doesn’t actually seem to be a valid card) you won’t be able to use this card to do what you want.
I’ve used the weblink in an entities card before, but you need to use it as an option under the entities collection on the entities card, you can’t use it as a card in its own right.
I don’t think you’ll be able to recreate your mockup with just the card-templater and entities cards.
Hi,
Great card ! I’m trying to template the state of a CO2 sensor entity (unit of measurement is ppm). I want it to display “very good”, “good”, “normal” and “bad” depending of the different values (state) of the sensor. I thought your card will be useful to do so BUT it will still display the unit of measurement next to the string (see the attached picture). Is there any way to get rid of it ?
Great addition, thank you so much !
Any chance to be able to icon_template ? I can see that I am able to define an icon using the without template method, but when tried to use icon_template with the template method, it didn’t work… ?
edit. actually, it seems like the template method (I tried with unit_of_measurement_template) is not working ? Did I do something wrong?
edit-2. OK got it, we must add the state_template line in order to get the attributes working, right ? What if I only need to change the attributes and not the state ?
I’ve just deployed 0.0.6b2, which allows templaing attributes without the state.
Incidentally, you mentioned templating the icon. This can actually be templated without using using state templating at all. Just do it like this (using a temperature sensor as an example):