Currently it seems as if a hyphen / dash is not allowed in the name of a device. I’m not sure if this is for HA reasons or ESPHome reasons but I thought I’d ask if it could be made to be allowed.
When migrating from Tasmota to ESPHome, all of my devices were named “sonoff-####” and now the have to be renamed “sonoff_####”
But I think in all (and to answer @dison4linux question finally) esphome tries to avoid any regressions which could be caused by any involved technologies. So it’s something to make the user happy
Is this true? I’m trying to find documentation somewhere on the limitations of mDNS and I can’t find where it says that underscores are okay but dashes/hyphens are not.
Although no technical limitation exists to use any character in domain name labels which are representable by an octet, hostnames use a preferred format and character set. The characters allowed in labels are a subset of the ASCII character set, consisting of characters a through z , A through Z , digits 0 through 9 , and hyphen. This rule is known as the LDH rule (letters, digits, hyphen). Domain names are interpreted in case-independent manner.[26] Labels may not start or end with a hyphen.[27] An additional rule requires that top-level domain names should not be all-numeric.[27]
I couldn’t find anywhere in the Multicast DNS Wiki that says anything explicitly about the naming convention. Please share details because I had the same question: “Why can’t ESPHome.io use the DNS naming convention?” I want to line up my DNS names with my device names but I cannot unless I avoid using underscores and hyphens.