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.03k stars 29.69k forks source link

HomeKit will not start: cannot import name 'Accessory' #14035

Closed WirelessMind closed 6 years ago

WirelessMind commented 6 years ago

Home Assistant release with the issue:

0.67.1

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.4 (stretch) Release: 9.4 Codename: stretch

Component/platform:

HomeKit, https://www.home-assistant.io/components/homekit/

Description of problem: Invalid config The following components and platforms could not be set up: homekit Please check your config.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

homekit:
  pincode: !secret homekit_pin

Traceback (if applicable):

Error during setup of component homekit

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 4, in <module>
    from pyhap.accessory import Accessory, Bridge, Category
ImportError: cannot import name 'Accessory'

Additional information:

cdce8p commented 6 years ago

Check out https://www.home-assistant.io/components/homekit/ The pincode option is no longer supported. For the first start homekit: should be enough.

WirelessMind commented 6 years ago

I get same error even without pincode!

2018-04-22 12:43:33 INFO (MainThread) [homeassistant.setup] Setting up homekit
2018-04-22 12:43:33 ERROR (MainThread) [homeassistant.setup] Error during setup of component homekit
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 4, in <module>
    from pyhap.accessory import Accessory, Bridge, Category
ImportError: cannot import name 'Accessory'
2018-04-22 12:43:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: level=ERROR, message=Error during setup of component homekit, source=components/homekit/accessories.py, exception=Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 4, in <module>
    from pyhap.accessory import Accessory, Bridge, Category
ImportError: cannot import name 'Accessory'
, timestamp=1524393813.2296653>
2018-04-22 12:43:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=message=The following components and platforms could not be set up:

 - [homekit](https://home-assistant.io/components/homekit/)

Please check your config., title=Invalid config, notification_id=invalid_config, service_call_id=1974142512-1>
2018-04-22 12:43:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, entity_id=persistent_notification.invalid_config, new_state=<state persistent_notification.invalid_config=notifying; message=The following components and platforms could not be set up:

 - [homekit](https://home-assistant.io/components/homekit/)

Please check your config., title=Invalid config @ 2018-04-22T12:43:33.272924+02:00>>
2018-04-22 12:43:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1974142512-1>
cdce8p commented 6 years ago

The cause for the ImportError might be that HAP-python wasn't installed correctly through Home Assistant. Could you try deleting the following folders and restart Home Assistant:

That should trigger a new installation for HAP-python. Alternatively an update to the current beta should do this as well, since it includes the update to HAP-python 1.1.9.

WirelessMind commented 6 years ago

I delete pyhap I delete HAP_python-1.1.8.dist-info, because I haven't HAP_python-1.1.8.egg-info

At restart, he recreate the 2 directory: pyhap and HAP_python-1.1.8.dist-info

But it's doesn't work:

2018-04-22 13:24:51 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: level=ERROR, timestamp=1524396291.4177794, message=Error during setup of component homekit, exception=Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 4, in <module>
    from pyhap.accessory import Accessory, Bridge, Category
  File "/srv/homeassistant/lib/python3.5/site-packages/pyhap/accessory.py", line 9, in <module>
    from pyqrcode import QRCode
ImportError: cannot import name 'QRCode'
, source=components/homekit/accessories.py>
2018-04-22 13:24:51 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1974325488-1, domain=persistent_notification, service=create, service_data=notification_id=invalid_config, message=The following components and platforms could not be set up:

 - [homekit](https://home-assistant.io/components/homekit/)
cdce8p commented 6 years ago

That's progress, since it isn't HAP-python anymore. In the same folder delete:

It might be because pypi had an issue a few days ago that caused problems when installing dependencies. There might be other packages that also don't work.

WirelessMind commented 6 years ago

Always the same problem:

2018-04-25 21:25:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component homekit
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 4, in <module>
    from pyhap.accessory import Accessory, Bridge, Category
  File "/srv/homeassistant/lib/python3.5/site-packages/pyhap/accessory.py", line 9, in <module>
    from pyqrcode import QRCode
ImportError: No module named 'pyqrcode'

are gone

cdce8p commented 6 years ago

I see. My mistake. PYQRCode will only be installed together with HAP-python. Can you try deleting all four folders (the ones for HAP-python and PyQRCode) and restart Home Assistant?

WirelessMind commented 6 years ago

always problem :(

2018-04-25 22:17:24 ERROR (MainThread) [homeassistant.setup] Error during setup of component homekit
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 55, in async_setup
    homekit.setup()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 157, in setup
    from .accessories import HomeBridge, HomeDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 5, in <module>
    from pyhap.accessory_driver import AccessoryDriver
  File "/srv/homeassistant/lib/python3.5/site-packages/pyhap/accessory_driver.py", line 41, in <module>
    from pyhap.hap_server import HAPServer
  File "/srv/homeassistant/lib/python3.5/site-packages/pyhap/hap_server.py", line 18, in <module>
    from tlslite.utils.chacha20_poly1305 import CHACHA20_POLY1305
ImportError: cannot import name 'CHACHA20_POLY1305'
cdce8p commented 6 years ago

Thats another dependency. It seems like all your HAP-python deps are broken. Try deleting the following:

After a restart, that should hopefully cover it.

WirelessMind commented 6 years ago

now it's ok!!! Even if my iphone can't connect to Home Assistant. I digit pin, iphone find home assistant, I click to Add anyway... but after iphone can't add Home Assistant!!!

cdce8p commented 6 years ago

Can you enable debug logging? Docs After that, please restart the Raspberry not just Home Assistant. If pairing is still not possible, please post the debug/error log.

WirelessMind commented 6 years ago

I already restarted the Raspberry. I restarted again and nothing of interesting in the log. Rather, after restart I get an error on the battery script. This is the log:

2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=turn_off, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=toggle, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=check_config, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=reload_core_config, domain=homeassistant>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=create, domain=persistent_notification>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=dismiss, domain=persistent_notification>
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger
2018-04-25 23:17:29 INFO (MainThread) [homeassistant.setup] Setting up logger
2018-04-25 23:18:18 DEBUG (MainThread) [homeassistant.components.homekit] Begin setup HomeKit
2018-04-25 23:18:19 INFO (MainThread) [pyhap.accessory_driver] Loading Accessory state from `/home/homeassistant/.homeassistant/.homekit.state`
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_dewpoint_temperature" as "TemperatureSensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_temperature" as "TemperatureSensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.battery_watcharia" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_humidity" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_cloudiness" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_low_clouds" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.battery_ichipx" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_medium_clouds" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_high_clouds" as HumiditySensor"
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Add "sensor.weather_fog" as HumiditySensor"
2018-04-25 23:19:06 INFO (Thread-3) [homeassistant.components.homekit.util] Pincode: 876-94-747
2018-04-25 23:19:06 DEBUG (Thread-3) [homeassistant.components.homekit] Driver start
2018-04-25 23:19:06 INFO (Thread-3) [pyhap.accessory_driver] Starting accessory 'Home Assistant' on address '192.168.0.120', port '51827'.
2018-04-25 23:19:06 DEBUG (Thread-23) [homeassistant.components.homekit.type_sensors] sensor.weather_cloudiness: Percent set to 97%
2018-04-25 23:19:06 DEBUG (Thread-27) [homeassistant.components.homekit.type_sensors] sensor.weather_low_clouds: Percent set to 0%
2018-04-25 23:19:06 DEBUG (Thread-28) [homeassistant.components.homekit.type_sensors] sensor.weather_humidity: Percent set to 94%
2018-04-25 23:19:06 DEBUG (Thread-29) [homeassistant.components.homekit.type_sensors] sensor.weather_temperature: Current temperature set to 14°C
2018-04-25 23:19:06 DEBUG (Thread-30) [homeassistant.components.homekit.type_sensors] sensor.battery_ichipx: Percent set to 59%
2018-04-25 23:19:06 DEBUG (Thread-32) [homeassistant.components.homekit.type_sensors] sensor.battery_watcharia: Percent set to 43%
2018-04-25 23:19:06 DEBUG (Thread-33) [homeassistant.components.homekit.type_sensors] sensor.weather_high_clouds: Percent set to 97%
2018-04-25 23:19:06 DEBUG (Thread-34) [homeassistant.components.homekit.type_sensors] sensor.weather_dewpoint_temperature: Current temperature set to 14°C
2018-04-25 23:19:16 ERROR (MainThread) [homeassistant.components.cloud] Error fetching Cognito keyset: 
2018-04-25 23:19:16 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.squeezelite is taking over 10 seconds
2018-04-25 23:19:16 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.orange is taking over 10 seconds
2018-04-25 23:19:16 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.night is taking over 10 seconds
2018-04-25 23:19:16 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.spotify is taking over 10 seconds
2018-04-25 23:19:16 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:19:16 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:19:16 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:19:16 WARNING (MainThread) [homeassistant.components.media_player] Updating squeezebox media_player took longer than the scheduled update interval 0:00:10
2018-04-25 23:19:40 DEBUG (Thread-7) [homeassistant.components.homekit.type_sensors] sensor.battery_watcharia: Percent set to 43%
2018-04-25 23:21:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.orange is taking over 10 seconds
2018-04-25 23:21:05 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:21:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.night is taking over 10 seconds
2018-04-25 23:21:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.squeezelite is taking over 10 seconds
2018-04-25 23:21:05 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:21:05 ERROR (MainThread) [homeassistant.components.media_player.squeezebox] Failed communicating with LMS: <class 'concurrent.futures._base.TimeoutError'>
2018-04-25 23:21:06 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 318, in keep_alive
    self.update_device(devicename)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 404, in update_device
    battery = status.get('batteryLevel', 0) * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
2018-04-25 23:21:39 ERROR (MainThread) [homeassistant.components.camera.generic] Error getting new camera image: Response payload is not completed
2018-04-25 23:22:01 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 318, in keep_alive
    self.update_device(devicename)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 404, in update_device
    battery = status.get('batteryLevel', 0) * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
2018-04-25 23:22:22 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.spotify is taking over 10 seconds
2018-04-25 23:22:53 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.spotify is taking over 10 seconds
2018-04-25 23:23:47 ERROR (MainThread) [homeassistant.components.camera.generic] Error getting new camera image: Response payload is not completed
2018-04-25 23:23:51 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 318, in keep_alive
    self.update_device(devicename)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 404, in update_device
    battery = status.get('batteryLevel', 0) * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
2018-04-25 23:23:51 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 318, in keep_alive
    self.update_device(devicename)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 404, in update_device
    battery = status.get('batteryLevel', 0) * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
2018-04-25 23:23:51 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 318, in keep_alive
    self.update_device(devicename)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/icloud.py", line 404, in update_device
    battery = status.get('batteryLevel', 0) * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
cdce8p commented 6 years ago

This log doesn't include the pairing, does it? If not, can you try to pair the Home Assistant Bridge to HomeKit until you see the error that the accessory couldn't be paired.

The errors above are related to the icloud device tracker and other components, but not HomeKit.

WirelessMind commented 6 years ago

Actually there is also the pairing. Or at least the phone looked for the object and found the Home Assistant with the pincode. But then it can't connect, but there is nothing in the log.

cdce8p commented 6 years ago

That's strange. There should be pairing logs if you tried. You have add this to your config file, have you?

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    pyhap: debug
WirelessMind commented 6 years ago

Yes! This is my logger configuration! I expected to find something about homekit in the log... Now I'm at work. I'll try again when I get home.

cdce8p commented 6 years ago

I would expect something like this:

2018-04-26 13:23:00 DEBUG (Thread-4) [homeassistant.components.homekit] Driver start
2018-04-26 13:23:00 INFO (Thread-4) [pyhap.accessory_driver] Starting accessory 'Home Assistant' on address '192.168.178.44', port '51827'.
2018-04-26 13:23:20 INFO (Thread-15) [pyhap.hap_server] Got connection with ('192.168.178.74', 64488).
2018-04-26 13:23:20 DEBUG (Thread-16) [pyhap.hap_server] Request POST from address '('192.168.178.74', 64488)' for path '/pair-setup'.
2018-04-26 13:23:20 DEBUG (Thread-16) [pyhap.hap_server] Pairing [1/5]
2018-04-26 13:23:20 INFO (Thread-16) [pyhap.hap_server] 192.168.178.74 - "POST /pair-setup HTTP/1.1" 200 -
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Request POST from address '('192.168.178.74', 64488)' for path '/pair-setup'.
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Pairing [2/5]
2018-04-26 13:23:28 INFO (Thread-16) [pyhap.hap_server] 192.168.178.74 - "POST /pair-setup HTTP/1.1" 200 -
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Request POST from address '('192.168.178.74', 64488)' for path '/pair-setup'.
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Pairing [3/5]
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Pairing [4/5]
2018-04-26 13:23:28 DEBUG (Thread-16) [pyhap.hap_server] Pairing [5/5]
2018-04-26 13:23:28 INFO (Thread-16) [pyhap.accessory_driver] Paired with XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
2018-04-26 13:23:30 INFO (Thread-16) [pyhap.hap_server] 192.168.178.74 - "POST /pair-setup HTTP/1.1" 200 -
2018-04-26 13:23:30 INFO (Thread-15) [pyhap.hap_server] Got connection with ('192.168.178.74', 64489).
2018-04-26 13:23:30 DEBUG (Thread-17) [pyhap.hap_server] Request POST from address '('192.168.178.74', 64489)' for path '/pair-verify'.
2018-04-26 13:23:30 DEBUG (Thread-17) [pyhap.hap_server] Pair verify [1/2].
2018-04-26 13:23:30 INFO (Thread-17) [pyhap.hap_server] 192.168.178.74 - "POST /pair-verify HTTP/1.1" 200 -
2018-04-26 13:23:30 DEBUG (Thread-17) [pyhap.hap_server] Request POST from address '('192.168.178.74', 64489)' for path '/pair-verify'.
2018-04-26 13:23:30 DEBUG (Thread-17) [pyhap.hap_server] Pair verify [2/2]
2018-04-26 13:23:30 DEBUG (Thread-17) [pyhap.hap_server] Pair verify with client '('192.168.178.74', 64489)' completed. Switching to encrypted transport.

Note: I left out some log messages.

WirelessMind commented 6 years ago

nothing... only:

2018-04-26 19:49:52 INFO (Thread-21) [homeassistant.components.homekit.util] Pincode: 598-07-890
2018-04-26 19:49:52 DEBUG (Thread-21) [homeassistant.components.homekit] Driver start
2018-04-26 19:49:52 INFO (Thread-21) [pyhap.accessory_driver] Starting accessory 'Home Assistant' on address '192.168.0.120', port '51827'.

Nothing about pairing!

cdce8p commented 6 years ago

Can you describe what steps you have taken before getting this log, but after the restart? I'm not sure I fully understand at which point your setup fails at the moment.

WirelessMind commented 6 years ago

I restart Raspberry. When home assistant is running I open Home app on the iphone. I tap "Add accessory". After "Don't have a code or can't scan?"... I tap "insert" and insert pin code (of Home Assistant). It find Home Assistant (the first time, now Home Assistant is already present). I tap on it. I get "Uncertified Accessory etc etc", so I click "Add anymway". At this point my iphone try to connect for some minutes. I wait but after... iphone can't connect.

In the log there is nothing!

cdce8p commented 6 years ago

Really strange.

Can you go through this once more and then stop Home Assistant. Due to the async nature sometimes log messages might only be added then. If that still doesn't work, can you try adding the bridge with the following homekit config:

homekit:
  filter:
    include_entities:
      - demo.demo

That should exclude all accessory, except for the Home Assistant Bridge. If it works we can start figuring out what doesn't.

WirelessMind commented 6 years ago

I added

  filter:
    include_entities:
      - demo.demo

So I connect to Home Assistant. After I remove

  filter:
    include_entities:
      - demo.demo

and now it's all ok!

But why do I read "current relative humidity" on others "sensor" like battery percentage or weather medium clouds?

cdce8p commented 6 years ago

A bit strange that it works now, but good too.

current relative humidity

Take a look at the docs. At the moment every sensor that reports it's state in % will be added as a humidity sensor. I know this is not ideal and was already thinking about changing it for 0.69.

WirelessMind commented 6 years ago

Ok! Thank you!!! At the moment I tried Home Assistant app and HomeKit app. I prefer Home Assistant!!! :)