Is it possible to display (name: ) a substring of the actual name?

I have friendly names for devices which are descriptive but too long (the friendly names are inherited via autodiscovery).

An example would be salon_capteur_temperature: when displayed, it is too long and part of the name is redundant (when the card is “Temperatures” I do not need “_temperature” in the displayed name).

Is there a way to display a portion of the name, based on some kind of matching?

That could be

  • a regex: .+_(.+)_.* would match capteur from the example salon_capteur_temperature
  • a Python expression: "salon_capteur_temperature".split("_")[1]

I use the entity id for the “detailed” description of the device and friendly name for what I want to be shown in the frontend.

e.g. entitiy_id: light.temperature_living_room and friendly name: Living Room

Also where do you want to to display this? Some cards have a property title or something similiar that you can set instead of using the friendly name of the entity.