Integrating with HikVision & HA

Hi

I hope I have put this in the right category. I am trying to integartion to work as detailed here in Hikvision - Home Assistant

But is throwing the following error

Logger: homeassistant.components.binary_sensor
Source: helpers/entity_platform.py:361
Integration: Binary Sensor (documentation, issues)
First occurred: 12:28:12 (1 occurrences)
Last logged: 12:28:12

Error while setting up hikvision platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hikvision/binary_sensor.py", line 110, in setup_platform
    data = HikvisionData(hass, url, port, name, username, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hikvision/binary_sensor.py", line 157, in __init__
    self.camdata = HikCamera(self._url, self._port, self._username, self._password)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 116, in __init__
    self.initialize()
  File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 274, in initialize
    device_info = self.get_device_info()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhik/hikvision.py", line 360, in get_device_info
    tag = item.tag.split('}')[1]
          ~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Appreciate any insights people may have

1 Like