home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.27k forks source link

Containerised deployment, wrong HomeKit advertised address #116768

Closed eutampieri closed 1 week ago

eutampieri commented 2 weeks ago

The problem

The integration advertises both the container address and the given address, and Apple Home refuses to connect to it. Here’s the advertisement: IMG_1497

What version of Home Assistant Core has the issue?

core-2024.5.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

HomeKit bridge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `homekit` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


homekit documentation homekit source (message by IssueLinks)

eutampieri commented 2 weeks ago

I forgot to add that I added this to my configuration.yaml and that I'm running under k8s (but the latter shouldn’t matter anyways):

homekit:
  advertise_ip: "192.168.1.9"
bdraco commented 2 weeks ago

Please post diagnostics for the config entry

eutampieri commented 1 week ago

config_entry-homekit-c750a60eef28a93707ccb1fc252a8674.json Here you are

bdraco commented 1 week ago

advertise_ip is not making it into the entry data/options which would explain why its using the defaults.

    "config-entry": {
      "title": "HASS Bridge EH:21068",
      "version": 1,
      "data": {
        "name": "HASS Bridge EH",
        "exclude_accessory_mode": true,
        "port": 21068
      },
      "options": {
        "filter": {
          "include_domains": [
            "light"
          ],
          "include_entities": [],
          "exclude_domains": [],
          "exclude_entities": []
        },
        "mode": "bridge"
      }

Please post the full yaml configuration as well

bdraco commented 1 week ago

I'll take a guess and assume that the config you posted above is the full configuration you have in YAML.

Your YAML config is creating another bridge. If you want to configure via YAML you need to delete the one you setup in the UI and switch to YAML. Its not possible to adjust the setting of a bridge created in the UI from YAML.

eutampieri commented 1 week ago

Yes, that explains why I have another bridge now. However, why do I get the IP in the advertisement? For now, I’ll close the issue. If deleting and recreating the bridge won’t solve the issue, I’ll reopen it. Thank you very much!

bdraco commented 1 week ago

However, why do I get the IP in the advertisement?

The default behavior is to make the bridge available on all interfaces, since the bridge was created in the UI it uses the default behavior.

iOS usually tries every ip address if it can't connect to the first one

eutampieri commented 1 week ago

I recreated the bridge, and it works (wrong port in k8s service :)) Also, worth mentioning in the documentation that ip_address is the HAP binding IP, so in my case I had to comment otherwise the socket would bind to an unavailable interface. I'd open a PR, but I don't know where.

bdraco commented 1 week ago

I'd open a PR, but I don't know where.

You can find the edit link at the bottom of the docs: https://www.home-assistant.io/integrations/homekit/

Screenshot 2024-05-05 at 3 01 29 PM