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
72.63k stars 30.4k forks source link

Want to add Homekit device, get KeyError: ‘Item 31 not found’ #32060

Closed URBANsUNITED closed 4 years ago

URBANsUNITED commented 4 years ago

The problem

Hi!

I am trying to add some Sonoff basic converted to Home Accessory Architect former Ravencore (https://github.com/RavenSystem/esp-homekit-devices) with the latest firmware. In my log I found the following entry as the Homekit devices didn’t get recognized. Is there something I can/must change? I have two Xiaomi Homekit light bulbs in my home, but can't get them recognized too.

Environment

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 127, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 50, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 59, in post
    handler, context={"source": config_entries.SOURCE_USER}
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 107, in async_step_user
    all_hosts = await self.hass.async_add_executor_job(self.controller.discover, 5)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homekit/controller/controller.py", line 90, in discover
    return discover_homekit_devices(max_seconds)
  File "/usr/local/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 102, in discover_homekit_devices
    info.properties
  File "/usr/local/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 180, in parse_discovery_properties
    d['category'] = Categories[int(category)]
  File "/usr/local/lib/python3.7/site-packages/homekit/model/categories.py", line 94, in __getitem__
    raise KeyError('Item {item} not found'.format(item=item))
KeyError: 'Item 31 not found'

Additional information

The other way round, bringen HA to Homekit works. I could add my HA hub to Homekit without any problems.

URBANsUNITED commented 4 years ago

We can close this case! Did a complete fresh install and the problem is gone. No idea why, but all works as it should. Sorry!

probot-home-assistant[bot] commented 4 years ago

Hey there @Jc2k, mind taking a look at this issue as its been labeled with a integration (homekit_controller) you are listed as a codeowner for? Thanks!