-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI banner displays .local domain in HA URLs regardless of user-provided settings #499
Comments
Thank you, my network is ".lan" as provided by pi-hole. So this message from "ha banner" is missleading. |
With user configured domain you mean the domain suffix as provided through DHCP? This might be the better option here indeed. We kinda use mDNS as fallback since most folks have mDNS enabled and almost all platform support it out-of-the box. So it is a somewhat safe fallback. I guess the question would be how many folks have a borked router/setting where the DHCP provided suffix ends up not working 🤔 😬 Also, technically if you have two instances with the same name, your DHCP might not allocate the domain name for you. But that problem also exists on mDNS so 🤷♂️ . Maybe we could even learn if that was the case from the DHCP response? 🤔 |
Hm, yeah NetworkManager actually exposes quite some information:
I guess if we look at this information we can say with reasonably high accuracy that |
I think you're right that those values would work in the case of DHCP-assigned hostname. A full solution would also have to account for cases where HA has been configured with a static IP & hostname; and also perhaps cases where DHCP is used but the DHCP server doesn't provide all those values. It seems like this logic is already present, as the settings dashboard gives the option to use an automatic local URL or override it: Maybe the same result could be of use to the CLI as well? |
I noticed today that the welcome banner in the CLI includes two URLs to Home Assistant endpoints:
These endpoints are hard-coded to use the
.local
domain, as seen here in cmd/banner.go:cli/cmd/banner.go
Lines 167 to 168 in 8d8c11a
In my case, these URLs were not working because I had not enabled mDNS on my network.
Enabling mDNS would fix the issue on my network, but I think it would be better if HA reported the user-configured domain where possible, then gracefully fall back to
.local
if no domain is available.Can anyone think of any downsides to this approach? Would there be any interest in merging a PR to make this change? Is this info even available to the CLI, or would I have to move upstream and change the Supervisor info API?
The text was updated successfully, but these errors were encountered: