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
71.89k stars 30.11k forks source link

Homekit Bridge needs repaired after HA restart (docker / linux) #95739

Closed twonycot closed 1 year ago

twonycot commented 1 year ago

The problem

I have a clean install of HA on docker (using portainer). I have set up a HomeKit bridge. It will pair and let me set up the connected accessories. However, once I restart HA for any reason it will lose its connection. When HA comes back up it will show a new pairing option in the notifications. The only way to get it to work again is to repair it with the HOME app.

What version of Home Assistant Core has the issue?

core-2022.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Homekit

Link to integration documentation on our website

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

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant Container", "version": "2022.5.4", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.9.9", "docker": true, "arch": "x86_64", "timezone": "America/New_York", "os_name": "Linux", "os_version": "5.19.0-46-generic", "run_as_root": true }, "custom_components": {}, "integration_manifest": { "domain": "homekit", "name": "HomeKit", "documentation": "https://www.home-assistant.io/integrations/homekit", "requirements": [ "HAP-python==4.4.0", "fnvhash==0.1.0", "PyQRCode==1.2.1", "base36==0.1.1" ], "dependencies": [ "ffmpeg", "http", "network" ], "after_dependencies": [ "camera", "zeroconf" ], "codeowners": [ "@bdraco" ], "zeroconf": [ "_homekit._tcp.local." ], "config_flow": true, "iot_class": "local_push", "loggers": [ "pyhap" ], "is_built_in": true }, "data": { "status": 1, "config-entry": { "title": "Home Assistant Bridge:21063", "version": 1, "data": { "name": "Home Assistant Bridge", "port": 21063 }, "options": { "filter": { "include_entities": [ "switch.calebs_camera_power", "switch.calebs_heater", "switch.driveway_camera_power", "switch.driveway_flood_light", "switch.front_porch_camera_power", "switch.front_porch_string_lights" ], "exclude_entities": [], "include_domains": [], "exclude_entity_globs": [], "include_entity_globs": [], "exclude_domains": [] }, "entity_config": {}, "mode": "bridge" } }, "accessories": [ { "aid": 1, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "Home Assistant" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "Bridge" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Home Assistant Bridge" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "homekit.bridge" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "A2", "characteristics": [ { "iid": 9, "type": "37", "perms": [ "pr", "ev" ], "format": "string", "value": "01.01.00" } ] } ] }, { "aid": 2389030616, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "Third Reality, Inc" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "3RSP019BZ" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Caleb\u2019s Heater" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.calebs_heater" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": false } ] } ] }, { "aid": 506168172, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "eWeLink" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "SA-003-Zigbee" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Driveway Camera Power" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.driveway_camera_power" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": true } ] } ] }, { "aid": 490693120, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "Third Reality, Inc" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "3RSP019BZ" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Caleb\u2019s Camera Power" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.calebs_camera_power" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": true } ] } ] }, { "aid": 3651149451, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "eWeLink" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "SA-003-Zigbee" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Front Porch Camera Power" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.front_porch_camera_power" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": true } ] } ] }, { "aid": 3749581525, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "Third Reality, Inc" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "3RSP019BZ" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Driveway Flood Light" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.driveway_flood_light" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": false } ] } ] }, { "aid": 3885395615, "services": [ { "iid": 1, "type": "3E", "characteristics": [ { "iid": 2, "type": "14", "perms": [ "pw" ], "format": "bool" }, { "iid": 3, "type": "20", "perms": [ "pr" ], "format": "string", "value": "Third Reality, Inc" }, { "iid": 4, "type": "21", "perms": [ "pr" ], "format": "string", "value": "3RSP019BZ" }, { "iid": 5, "type": "23", "perms": [ "pr" ], "format": "string", "value": "Front porch string lights" }, { "iid": 6, "type": "30", "perms": [ "pr" ], "format": "string", "value": "switch.front_porch_string_lights" }, { "iid": 7, "type": "52", "perms": [ "pr" ], "format": "string", "value": "2022.5.4" } ] }, { "iid": 8, "type": "49", "characteristics": [ { "iid": 9, "type": "25", "perms": [ "pr", "pw", "ev" ], "format": "bool", "value": false } ] } ] } ], "client_properties": {}, "config_version": 3, "pairing_id": "DD:90:D1:D5:08:6A" } }

Example YAML snippet

homekit:
  - filter:
      include_entities:
        - switch.calebs_camera_power
        - switch.calebs_heater
        - switch.driveway_camera_power
        - switch.driveway_flood_light
        - switch.front_porch_camera_power
        - switch.front_porch_string_lights

Anything in the logs that might be useful for us?

Docker Compose
version: '3.1'

services:

  home-assistant:
    container_name: home-assistant
    image: homeassistant/home-assistant:2022.5.4
    restart: always
    network_mode: host
    volumes:
      - /home/server/docker-files/home-assistant:/config
      - /etc/localtime:/etc/localtime:ro
      - /dev/serial/by-id:/dev/serial/by-id
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    ports:
      - 8123:8123
      - 1400:1400

    environment:
      TZ: "America/New_York"

  hass-configurator:
    container_name: configurator
    image: "causticlab/hass-configurator-docker:latest"
    restart: always
    network_mode: bridge
    ports:
      - "3218:3218/tcp"

    volumes:
      - /home/server/docker-files/configurator:/config
      - /home/server/docker-files/home-assistant:/hass-config
    environment:
      - BASEPATH=/hass-config
      - ENFORCE_BASEPATH=true

Additional information

No response

home-assistant[bot] commented 1 year 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.

(message by CodeOwnersMention)


homekit documentation homekit source (message by IssueLinks)

bdraco commented 1 year ago

"HAP-python==4.4.0"

You need 4.7.0 or later

bdraco commented 1 year ago

core-2022.5.4 is ancient. It will not work with newer iOS.

Please upgrade to 2023.6.x