Homekit - After PIN no devices are found

Hi All

I had Homekit working in old versions, and after IOS13 I removed my home on the app
Since then I have not been able to do pairing?

  1. I deleted .homekit.state from config folder

  2. I removed all configuration for Homekit except:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    pyhap: debug

homekit:
  filter:
    include_entities:
      - demo.demo

I just get the “spinning wheel - add accessories” and it doesn’t find anything

I then looked through the logs but haven found any “smoking gun”?

2019-10-30 20:47:26 DEBUG (MainThread) [homeassistant.components.homekit] Begin setup HomeKit
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: Name to Home Assistant Bridge
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: SerialNumber to default
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: FirmwareRevision to 0.100.3
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: Manufacturer to Home Assistant
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: Model to Bridge
2019-10-30 20:47:26 DEBUG (SyncWorker_8) [pyhap.characteristic] set_value: SerialNumber to homekit.bridge
2019-10-30 20:47:47 WARNING (SyncWorker_0) [homeassistant.components.sonos.media_player] Failed to initialize '192.168.0.104'
2019-10-30 20:47:47 INFO (SyncWorker_8) [pyhap.accessory_driver] Storing Accessory state in `/config/.homekit.state`
2019-10-30 20:47:47 INFO (SyncWorker_8) [homeassistant.components.homekit.util] Pincode: 682-00-447
2019-10-30 20:47:47 DEBUG (SyncWorker_8) [homeassistant.components.homekit] Driver start
2019-10-30 20:47:47 INFO (SyncWorker_3) [pyhap.accessory_driver] Starting the event loop
2019-10-30 20:47:47 DEBUG (SyncWorker_3) [pyhap.accessory_driver] Not setting a child watcher. Set one if subprocesses will be started outside the main thread.
2019-10-30 20:47:47 INFO (SyncWorker_0) [pyhap.accessory_driver] Starting accessory Home Assistant Bridge on address 192.168.0.12, port 51827.
2019-10-30 20:47:47 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting event thread.
2019-10-30 20:47:47 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting server.
2019-10-30 20:47:47 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting mDNS.
2019-10-30 20:47:48 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device Home Assistant Bridge (Home Assistant Bridge - B8:F9:97:97:9B:3F)
2019-10-30 20:47:48 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting accessory.
2019-10-30 20:47:48 DEBUG (SyncWorker_0) [pyhap.accessory_driver] AccessoryDriver started successfully

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            2019-10-30 20:50:04 WARNING (MainThread) [homeassistant.components.camera] Updating synology camera took longer than the scheduled update interval 0:00:30
2019-10-30 20:50:18 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.ds_2cd2332_i_28mm fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 164, in _new_conn
    % (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa3b7c3af50>, 'Connection to 192.168.0.10 timed out. (connect timeout=60)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))

I found this during trouble shooting and reading the FAQ:

Pairing hangs - no error

  1. Make sure that you don’t try to add more than 100 accessories, see device limit. In rare cases, one of your entities doesn’t work with the HomeKit component. Use the filter to find out which one. Feel free to open a new issue in the home-assistant repo, so we can resolve it.
  2. Check logs, and search for Starting accessory Home Assistant Bridge on address . Make sure Home Assistant Bridge hook ups to a correct interface. If it did not, explicitly set homekit.ip_address configuration variable.

And looking at the logfile I have this started and with correct IP and port?

Is there any other clear old Homekit FAQ I am missing?

And does anyone know how to use this reset_accessory?:

Resetting accessories

On Home Assistant 0.97.x or later, you may use the service homekit.reset_accessory with one or more entity_ids to reset accessories whose configuration may have changed. This can be useful when changing a media_player’s device class to tv , linking a battery, or whenever HomeAssistant add supports for new HomeKit features to existing entities.

tried it again with only lights in the included accessories…
But it still just hangs on the App “Adding accessories”

The logs look okay:

2019-10-30 21:31:07 INFO (SyncWorker_3) [homeassistant.components.homekit.util] Pincode: 545-53-299
2019-10-30 21:31:07 DEBUG (SyncWorker_3) [homeassistant.components.homekit] Driver start
2019-10-30 21:31:07 INFO (SyncWorker_6) [pyhap.accessory_driver] Starting the event loop
2019-10-30 21:31:07 DEBUG (SyncWorker_6) [pyhap.accessory_driver] Not setting a child watcher. Set one if subprocesses will be started outside the main thread.
2019-10-30 21:31:07 INFO (SyncWorker_0) [pyhap.accessory_driver] Starting accessory Home Assistant Bridge on address 192.168.0.12, port 51827.
2019-10-30 21:31:07 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting event thread.
2019-10-30 21:31:07 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting server.
2019-10-30 21:31:07 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting mDNS.
2019-10-30 21:31:07 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device Home Assistant Bridge (Home Assistant Bridge - DC:C4:59:A5:B0:75)
2019-10-30 21:31:08 DEBUG (SyncWorker_0) [pyhap.accessory_driver] Starting accessory.
2019-10-30 21:31:08 DEBUG (SyncWorker_0) [pyhap.accessory_driver] AccessoryDriver started successfully

I really don’t know what to try next? it used to work?

Can anyone share a “clear config” and start over guide?
I know this is not the most stable implementation and Homekit is tricky but this really worked great before…

Again thanks to all of this great community for sharing and helping strangers getting HA working!

Nobody who have tried this and come out the other end with a working Homekit?
Can I set it up on another instance of Hassio and just move the files afterwards?

Did you resolve this? I think I’m having the same issue.

Hi, I fixed this by:

  1. I deleted .homekit.state from config folder
  2. I deleted the bridge from iOS Home app by selecting a non-responsive device, and selecting Bridge> from settings.
  3. Changed the Mac Address of the HA host. - not sure if this is necessary, as it didn’t work after the first reboot, but after I powered it down and waited 10 minutes, was then able to re-pair with iOS Home App. I wondered if this was an Apple Server deleting the bridge timer issue? Anyway - thats what worked for me, cheers. Gerry