How I can change in ‘.yaml’ of ESPHome ‘network’ device name?
In my case it is shown on the ‘router’ as ‘ESP_E2A8B3’ and I would like to change that name to more friendly name…
Is that any ‘ESPHome’ ‘configuration variable’ to do that…?
Not sure if this is the correct way, but the following works for me:
Edit your ESPHome node yaml and add the manual_ip: option and configuration data. Also change the name: option to the new hostname.
Compile and upload this new config. It should prefer communication over fixed ip rather than hostname.
After successful upload, edit the yaml again and remove the previously added manual_ip: configuration. Now compile upload again. It should now try communication using the new hostname via mdns.
O.K. I’ll try that in weekend…
Hi, pulling an old thread…
- Is the manual IP step necessary ? I have not set manual IP configurations in the device YAML but I have added IP reservations on the router side. Is it the same, better or worse ?
- I have the same desire to change the names, when I initially set them up in ESPhome, I gave them generic names (i.e sonoff1, nodemcu1, etc…), now that their placement is stable, i would also like to make it more evident in the device names to see what they are…if i change the name on the YAML as indicated, will that change the names of the entities or require any re-config at all ?
Thanks !
Answering my own question on #1, as per the docs
If you’re having problems with your node not connecting to WiFi or the connection process taking a long time, it can be a good idea to assign a static IP address to the ESP. This way, the ESP doesn’t need to go through the slow DHCP process.
Still looking for advice on #2
This always works for me, and it’s recomended from ESPHome docs
esphome:
name: new_name
...
wifi:
use_address: old_name.local
...
cheers!!!
I would prefer using dns hostname rather than static ip. So if i want to migrate my devices to a different networks in case the new network might have different ip ranges.
I had the same issue that the filename doesn’t match the device name, so I went to edit, copied the whole config, deleted the device and then created a new device, named as I want and then paste the whole config back in and upload.
For anybody else stumbling across this when googling “how to change host name of an ESPHome device”, there is now a convenient option built right into the menu (3 vertical dots of the device in question) to change the host name right there.