How to give a name to mqtt variable?

Hello,

super simple question. I have a sensor

sensor:
  - platform: mqtt
    name: "Socket Washing Machine Tele Period"
    state_topic: "stat/tasmota-socket-washing-machine/RESULT"
    value_template: '{{ value_json["TelePeriod"] }}'
    unit_of_measurement: "s"  

Now i have variable named: sensor.socket_washing_machine_tele_period that is built from friendly name “Socket Washing Machine Tele Period” ?

So how to give a name to this variable that is built notof friendly name “Socket Washing Machine Tele Period” ?
For example just: sensor.washingmachine_teleperiod

unique_id do not works for me.

Thanks a lot!

Use the name to give it a sensor name and then change the friendly name to whatever you like afterwards.

1 Like

According to docs there is no friendly name for mqtt sensor :frowning:

I mean setting the friendly name through the UI or customize.yaml after you created the sensor.
Go to Developer Tools -> States, search for your entity, click on it, click on the small gear icon om the top right, out your desired friendly name in the field “Name Override”, press “Update” in the bottom right corner.

1 Like

I mean this name: “Socket Washing Machine Tele Period” - it looks friendly :rofl:

Please take a look

It i clear, thanks, but it is a little bit crooked way. So is there no direct way?

1 Like

Not as far as I know. I customize all entities through customize.yaml, so not that many steps.

1 Like

Could you advise how?

See the docs for details here. There’s a section Manual Customization that shows the way I do it.

1 Like

Thanks a lot!