I have a specific sensor (originating through MQTT) that has wither true or false as value. I would like to show this on my dashboard through a chips-card from mushroom. This will show the icon and value without the sensor name.
For this use-case it would be better if I could change the displayed value to “available” for true and “not available” for false.
I found templating, but somehow I can’t get that to work for me. I am quite new to HA, so I am probably overlooking something simple.
If the original sensor gives True or False and you want to show it as “Available” or “Not available”:
solution depends on where you need this presentation.
If in Entities card: use template-entity-row to show a customized state dependently on a real state.
If everywhere: create a template binary sensor (as it was suggested earlier) with a more fitting device_class. “Fitting” means that may be you will agree with using labels like “connected/disconnected” or “problem/ok”.
Alternatively : create template sensor which explicitly converts “true → available” and so on.
Customizing entities here will not help. Device classes meant for binary sensors cannot be used for sensors.
Since you want to use mushrooms - I would choose a template binary sensor with a fitting device class. Then you will get an automatic icon / icon color too (same may be achieved in template-entity-row in Entities card).