Pairing WebOS / LG 9C not working - getting error in the log after entering the pairing code

Hi HA Community!

I followed a couple of other articles to find a solution for the pairing the tv, from the discovery mode, but with no luck so far. I found similar problems with Pairing attempt failed with an unhandled exception errors, but none that look like this one.

I just updated from 98.xx to 103, but still same problem.

image

I get the Pairing screen up on the TV, and when I enter the code with the format XXX-XX-XXX, I get the following error - the TV then populate another code, and the same problem over again.

What to do?

2019-12-14 22:30:35 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 247, 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
2019-12-14 22:31: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 247, 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

I have the same issue here with my LG WebOS tv.

I used this to get it to work: https://www.home-assistant.io/integrations/webostv

Still need to figure out how to stop hassio from discovering this as Homekit Accessory. :sweat_smile:

Hi Vasco. Thanks for your swift reply. Okay, so you managed to get it to work 100% just by adding to the configuration,yaml? Can I have a look at your configuration?

this is what I have added:

media_player:
  - platform: webostv
    host: 192.168.1.41
    name: Woonkamer TV
    filename: webostv.conf
    timeout: 5
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: "XX:XX:XX:XX:XX:XX"
    customize:
      sources:
        - livetv
        - youtube
        - makotv
        - netflix

I have removed my mac address, replace all the XX:XX etc with your own. And obviously the LG IP Address

By the way Vasco, My configuration looks like this:

discovery:
enable:
- homekit

Which doesn’t show the configuration with HomeKit Acessory when turning on the TV. If I need to configure another HomeKit product, then i’ll just uncomment the ‘enable’-line

Thanks, my discovery did not have enable entity in it. What I’ve done now, because you triggered me, is add:

discovery:
   ignore:
      - homekit

This did the trick for me xD

It seems like the LG TV is meant to be used as a Homekit hub/ control centre. Is this the case? Could WebOS be used as a Homekit hub? I happen to be in need of one.

Hi. Maybe, however it can’t be added with HA integration configuration, as it fails with some out of bound index error in the log, so no luck here by having it configured, the only way I was able to do so, was to add the webos reference in the config.