Switch name based his state

hi,
first of all, I want to thanks in advance, because I’m a very beginner.
I created one switch on my dashboard, and I need to change his name based on his state, if is true or false. It’s possible ?
Below is my code of switch created,
I want name: AM when is false, and PM when state is true.

type: tile
entity: input_boolean.man_aut
name: AM
color: cyan
hide_state: true
vertical: false
features:

  • type: toggle
    features_position: inline

thanks

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Why?

It is easier to use the state of a sensor than the name.

Maybe change the switch to a input_text sensor or make a template of it as an input_text.
The input_text can have the stated AM and PM directly.

I’m not quite sure what exactly you want to do, but you could edit the visibility based on the state. So you will have two tiles but only one will show on your dashboard at a time because of the state. Give that a try?

Entity names can also hold variables:

You have to realize that if you change the name, then your automations and other stuff that use the name needs to be updated too.

He should be able to fix the entity name with the use of default_entity_id

In order for it to work it needs to be done programmatically and the effect should also take effect without user interaction and hopefully without too much other interference with the system, like reloading that might reset automations and other stuff.