Using readable name in notification

Hi,

I’m trying to send notifications with selected program of my washer.
I’m using a template with following code:

{{ states(‘sensor.bosch_wav28gh0fg_68a40e728cde_selected_program’) }}

the template returns: LaundryCare.Washer.Program.Mix

But when I check the entity, I see:
Wash: Mix

That is the text I want to use.

I thought I could use the friendly name, but that is not a possibility.

Anyone resolved this, or can point me in the right direction?

That looks like it might be some sort of language translation key that the front end is taking care of for you when you look at the entity in the UI, but, as you’ve seen, accessing the state via templates don’t get the same help.

You could use the marked answer in this thread to create a dictionary between the long-form state and the text you’d like to appear in your notification. Or, if Wash: Mix was the only one you need to change, you could do something like

{% if states(‘sensor.bosch_wav28gh0fg_68a40e728cde_selected_program’) == 'LaundryCare.Washer.Program.Mix' %}
  Wash: Mix
{% else %}
  {{ states(‘sensor.bosch_wav28gh0fg_68a40e728cde_selected_program’) }}
{% endif %}