dns-sd Registration Not Appearing in Browse After Being Accepted

279 views Asked by At

I'm running home-assistant in a docker container on MacOS Catalina and need to allow HomeKit to interface with it. I'm trying to register a service with dns-sd to get it to work based on a fix recommended in a thread on the issue. The registration works, but the service doesn't appear afterward if I understand it correctly.

I first enter:

dns-sd -B

I immediately get a list of services. The items are my ethernet connected cameras. I then enter:

dns-sd -R Homeassistant _hap._tcp local 51827 md=”HA Bridge” pv=1.0 c#=2 id=97:B0:2A:BC:1B:12 s#=1 sf=1 ci=2 ff=0 sh=UaTxqQ==

I get the response:

Got a reply for service Homeassistant._hap._tcp.local.: Name now registered and active

I Control+C to exit and reenter dns-sd B. The command hangs for several minutes and shows the same list prior to the registration. Should the registered item be showing with the B command?

Also, it would seem to me Homeassistant in the command would need to correspond to an actual service. How do I verify they match? When I run docker ps I get:

87ca131dbf58        homeassistant/home-assistant:stable   "/init"                  2 minutes ago       Up 2 minutes        0.0.0.0:8123->8123/tcp, 0.0.0.0:51827->51827/tcp   home-assistant

Is this what I should be matching? Since macOS is not case sensitive, they should match.

1

There are 1 answers

0
jnovack On BEST ANSWER

If I run the following (zsh):

❯ dns-sd -R Homeassistant _hap._tcp local 51827 md=”HA Bridge” pv=1.0 c\#=2 id=97:B0:2A:BC:1B:12 s\#=1 sf=1 ci=2 ff=0 sh=UaTxqQ==
Registering Service Homeassistant._hap._tcp.local port 51827 TXT md=”HA Bridge” pv=1.0 c#=2 id=97:B0:2A:BC:1B:12 s#=1 sf=1 ci=2 ff=0 sh=UaTxqQ==
DATE: ---Thu 01 Oct 2020---
14:28:56.697  ...STARTING...
14:28:57.358  Got a reply for service Homeassistant._hap._tcp.local.: Name now registered and active

I get the following when running:

❯ dns-sd -B _hap._tcp
Browsing for _hap._tcp
DATE: ---Thu 01 Oct 2020---
14:29:07.913  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
14:29:07.913  Add        3   1 local.               _hap._tcp.           Homeassistant
14:29:07.913  Add        3   5 local.               _hap._tcp.           Homeassistant
14:29:07.913  Add        3  23 local.               _hap._tcp.           Homeassistant
14:29:07.913  Add        3  24 local.               _hap._tcp.           Homeassistant
14:29:07.913  Add        2   4 local.               _hap._tcp.           Homeassistant

I believe you have an issue with:

  1. by default, you are not browsing _hap._tcp to see the entry.
  2. the port should correspond to the port you opened within Docker to that container.