core: homekit_controller: unable to complete pair_setup with LG TV

Home Assistant release with the issue: 0.97.2

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

Component/platform: homekit_controller

Description of problem: My tv got the update for homekit support last week and I decided to finally try adding it to homekit but it fails to set up which then the tv generates a completely new pairing code. I finally got time to try and add it and keep the logs open.

Traceback (if applicable):


2019-08-15 05:06:09 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device LG webOS TV D6DC (WEBOS - 3B:4F:73:.......)

2019-08-15 05:07:04 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 264, in async_update
    self.pollable_characteristics
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 290, in get_characteristics
    self.pairing.get_characteristics, *args, **kwargs
  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/ip_implementation.py", line 172, in get_characteristics
    self.session = IpSession(self.pairing_data)
  File "/usr/local/lib/python3.7/site-packages/homekit/controller/ip_implementation.py", line 441, in __init__
    c2a_key, a2c_key = get_session_keys(conn, pairing_data, write_fun)
  File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 311, in get_session_keys
    response_tlv = write_fun(request_tlv, step2_expectations)
  File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 79, in write_http
    connection.endheaders(request)
  File "/usr/local/lib/python3.7/http/client.py", line 1239, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/site-packages/homekit/http_impl/http_client.py", line 44, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out
2019-08-15 05:07:07 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 250, in async_step_pair
    await self.hass.async_add_executor_job(self.finish_pairing, code)
  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 391, in finish_pairing
    pairing = perform_pair_setup_part2(pin, str(uuid.uuid4()), write_fun, salt, pub_key)
  File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 173, in perform_pair_setup_part2
    assert response_tlv[0][0] == TLV.kTLVType_State and response_tlv[0][1] == TLV.M4, \
IndexError: list index out of range

Additional information: cc @Jc2k

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 33 (21 by maintainers)

Most upvoted comments

Agreed, it’s a shame neither of us were around when they were added to suggest that! That said, controlller is what Apple officially calls the consumer so I think it could be worse. Renaming would be hard at this point (too many users familiar with old names, and their configs would break if it changed), and we’ve tried to improve the docs. homekit_controller calls out the difference in the first paragraph of its docs. homekit has a callout right after the first paragraph. If you think you can improve the wording to be more noob friendly would definitely love to see a PR for that. But this is getting off topic - feel free to open a seperate ticket if you want to pursue this.