Currently I am trying some smart home software to integrate my homematic ccu2 and modbus pool control into it.
HomeAssistant is running dockered image: homeassistant/raspberrypi4-homeassistant:latest on a raspberry pi 4 with 4gb (armv7l).
While fiddling with home assistant for the last two days I couldn’t find a way to change the displayed name of a state from a switch. Currently it’s “An” (On), “Aus” (Off) but this doesn’t fit my needs.
Your if statement should work as long as state_attr(…) provides indeed a 0 or 1. Did you check that in Entwicklerwerkzeuge -> Vorlage. Delete everything thats shown there (CTRL-A, ENTF) and put in the following: {{ state_attr(“homematic.ccu2”, “Haus SV Anwesenheit”) }}
Is the result what you expect?
Disappointing. This is a standard thing. Why would I need to figure out another addon/plugin for such a simple feature. But that’s not your fault! Thank you for the link.
Ahh, just realized that you are trying to use a switch for that. As already been said, that doesn’t work. Another option might be a template sensor if you only want to display the state of the switch (a sensor cannot turn on/off) .
A particular solution depends on a particular place where a user needs it.
For instance, if a user needs a switch entity to be shown in Entities card w/o a toggle and with custom states like “activated/deactivated” - a template-entity-row may be used.
A mentioned button-card may define a custom state.
A mentioned config-template-card can be used in places like Glance card to define a custom state.
And no solution is available to show a custom state in more-info popups.