Add FAQ advising against underscores in hostnames. (#1366)

This commit is contained in:
Dave T 2021-08-10 13:16:29 +01:00 committed by GitHub
parent 4f9a2d478f
commit 9e38b66633
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -343,6 +343,14 @@ with a lot of work).
Always back up all your files!
Why shouldn't I use underscores in my device name?
--------------------------------------------------
The top level ``name:`` field in your .yaml file defines the node name(/hostname) on the local network. According to `RFC1912 <https://datatracker.ietf.org/doc/html/rfc1912>`_, underscore characters (``_``) in hostnames are not valid. In reality some local DNS/DHCP setups will be ok with underscores and some will not. If connecting via a static IP address, there will probably be no issues. In some cases, initial setup using an underscore works, but later the connection might fail when Home Assistant restarts or if you change router hardware. Recommendation: use hyphen (``-``) instead of underscore if you can.
Important: follow these `instructions </components/esphome.html#changing-esphome-node-name>`_ to use the ``use_address`` parameter when renaming a live device, as the connection to an existing device will only work with the old name until the name change is complete.
See Also
--------