Skip to content

CLI banner displays .local domain in HA URLs regardless of user-provided settings #499

@njbair

Description

@njbair

I noticed today that the welcome banner in the CLI includes two URLs to Home Assistant endpoints:

  Home Assistant URL:       http://homeassistant.local:8123
  Observer URL:             http://homeassistant.local:4357

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

fmt.Printf(" %-25s %s://%s.local:%d\n", "Home Assistant URL:", protocol, (*hostinfo)["hostname"], int(port))
fmt.Printf(" %-25s http://%s.local:%d\n", "Observer URL:", (*hostinfo)["hostname"], 4357)

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions