[SOLVED] Rename ESP device in HA

Hi.

How can I rename both the device and config file for a given ESP device?

image

I created it while I was re-designing and testing this new device which replaced the old one, but now it is in “production” and I want to adjust those details.

Thanks.

Hello, next time try the documentation first or a Google search.
Direct link to the answer:

1 Like

I don’t see how that link answers my question about the name of the YAML configuration file for that specific node and how to rename it.

Perhaps I didn’t understood your question.
From my point of view you want to change the name of the node and the name of the configuration file.

You can change the name of the file if you keep the content.
The difficulty is to change the name of a node in production. Because if you want to do an OTA update id you change the name the OTA won’t find your node on the network because it use a mDNS name based on the name.

So the idea describe in the documentation (Chapter “Changing ESPHome Node Name”) is:

  1. Keep the name but define the future name as network adresse in configuration file.
  2. Do the OTA update
  3. Change the name of the node with the new name in the configuration file.
  4. Do the OTA update.

Then you will have you in production node with a new name. Isn’t was you searching to do ?

I found renaming the config file causes the node to be lost and non-functioning
I simply:

  1. Copy the whole config (paste it into a temp text file just in case) and then delete the node - this willl delete the config file
  2. Create a new node, called what you want to change to
  3. Go into edit of the new node and paste the config back, overwriting what is there, make sure you change the nodename at the top to the new node name.
  4. Remove the integration from HA
  5. Upload to the device
  6. Add the integration into HA, with the ip address or newnodename.local, you may need to rename the entities as sometimes _2 is added
4 Likes

That was exactly what I end up doing :point_up:

Thank you both for the help

I’m also having kinda this issue. I want to rename some nodes and delete some test nodes as well.
Where did you find the delete option inside esphome?

Click the 3 dots on the upper right of the node and Delete is in there

Thanks for posting this. I had been looking in the docs for this, but I guess was missing it.

Here is another way (not saying it’s better, just another option):

  1. Enable Webserver in your current config, and update firmware
  2. Rename config files and directories
  3. Edit device name in renamed config, delete webserver from config (if you don’t need it anymore)
  4. Create and download new firmware
  5. Upload new firmware through webserver

If you don’t know exactly where to look, the answer is hard to find. Personally, I find the organization of the information fragmented and hard to follow.
The easiest way to change the identity of a node appears here, in the section labeled “Changing ESPHome Node Name”:

You would add the "use_address: " to the wifi section of the node’s yaml file, do an ota update, and then delete the use_address from the yaml file and save the file.

1 Like