Velux KLF200 - Unable to integrate with Home Assistant - SSL handshake is taking longer than 60.0 seconds

Hi!

I have 2 Velux windows, with roller shutters that I would like to automate to Home Assistant. For this purpose, I bought a KLF200 which I’m trying to configure. Unfortunately, I’m getting an SSL Handshake error.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 39, in async_setup
    await hass.data[DATA_VELUX].async_start()
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 84, in async_start
    await self.pyvlx.load_scenes()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/pyvlx.py", line 82, in load_scenes
    await self.scenes.load()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/scenes.py", line 51, in load
    await get_scene_list.do_api_call()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/api/api_event.py", line 21, in do_api_call
    await self.send_frame()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/api/api_event.py", line 33, in send_frame
    await self.pyvlx.send_frame(self.request_frame())
  File "/usr/local/lib/python3.10/site-packages/pyvlx/pyvlx.py", line 66, in send_frame
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/pyvlx.py", line 43, in connect
    await self.connection.connect()
  File "/usr/local/lib/python3.10/site-packages/pyvlx/connection.py", line 86, in connect
    self.transport, _ = await self.loop.create_connection(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1119, in _create_connection_transport
    await waiter
ConnectionAbortedError: SSL handshake is taking longer than 60.0 seconds: aborting the connection

As this is a new part of my setup, I can’t tell whether something is broken in the latest version of Home Assistant Core, or whether I’m just doing something wrong in configuration. I’ve read all threads I could find on the KLF200 integration, but most of those issues were resolved by either a new Home Assistant version or rebooting the KLF.

I have tried the following:

  • Updating Home Assistant to latest version
  • Multiple reboots of Home Assistant
  • Multiple reboots of KLF200
  • Logging in with velux123 (auth error)
  • Logging in with Wifi password (SSL Handshake error)

My setup is:

  • Home Assistant 2022.12.8
  • Supervisor 2022.11.2
  • Operating System 9.4
  • Frontend 20221213.1 - latest
  • Running on RPI 3b

The KLF200 is

  • Running the 2.0.0.71 firmware it was shipped with
  • Connected via Ethernet

Config in configuration.yaml
velux:
host: 192.168.0.110
password: Wifi Password listed on KLF200

I’m considering resetting the KLF200 to factory settings and retrying that way, perhaps trying to configure it to a different port? I don’t see any threads anymore mentioning other people with SSL handshake issues, so it looks like there’s no general issue anymore with the Home Assistant Core.

Anyone else having issues with Velux KLF200 currently, or have an idea on how to tackle this issue?

Thanks for your support!

I just tested my KLF200 (f/w 2.0.0.71) if everything still works as desired and without any problems.
I was able to operate the screens without any problems.

My HA (RPi 4B) works with the latest software.

Looks like you’ve set everything up correctly, so I suggest you factory reset the KLF200 and try again.
It is strange that you cannot log in locally with velux123, but maybe a factory reset will also solve this problem.

1 Like

Your configuration.yaml is correct.
I still get the handshake errors on occasions so that problem hasn’t been completely solved.
When it does occur, I power cycle the KLF200 and in my case the KLF200 has a white LED that starts flashing which should mean it is waiting for HA to connect to it, and then restarting HA it connects. It is rare that HA fails to connect at this point, but it does happen.

1 Like

Thanks @wmaker and @complex1 for your swift feedback.

I reset the klf200 to factory settings, together with installing the HACS version of MyVelux. I don’t know which of the two did the trick, but it worked, my veluxes are visible in Home Assistant now.

I probably could try uninstalling the HACS version and use the default integration, but I’m afraid I would break it again that way. I probably will keep it as is, but if I would attempt it, I’ll report back here.

I did lose a couple of hours figuring out how to link the veluxes to the klf again after the factory reset. Since I had linked them to the klf200 already, before the factory reset, they could not be found when searching for devices after factory reset.

So just an FYI for anyone who has this issue in the future: after the factory reset of the klf200, I had to fully reset the velux as well (pressing button next to motor with a paperclip) , link it to the Velux remote, and then could link it to the klf200 using that remote. Otherwise I just got the message ‘Could not find products.’

1 Like

Glad to read you were able to fix the issue. :+1:
I guess the factory reset did the job and not the HACS MyVelux add-on, because I do not use this add-on, moreover I didn’t even know the existence of it.
I just use the default integration provided by HA.
The downside of a factory reset is that you lose all settings made in the KLF200, but also the glitches are gone.

I know that the post is a liitle older but I am experiencing exactly the same issue

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 333, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 39, in async_setup
    await hass.data[DATA_VELUX].async_start()
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 84, in async_start
    await self.pyvlx.load_scenes()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/pyvlx.py", line 106, in load_scenes
    await self.scenes.load()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/scenes.py", line 56, in load
    await get_scene_list.do_api_call()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/api/api_event.py", line 29, in do_api_call
    await self.pyvlx.check_connected()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/pyvlx.py", line 83, in check_connected
    await self.connect()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/pyvlx.py", line 58, in connect
    await self.connection.connect()
  File "/usr/local/lib/python3.12/site-packages/pyvlx/connection.py", line 103, in connect
    self.transport, _ = await self.loop.create_connection(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1146, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1179, in _create_connection_transpor

I tried to Power on/Off the KLF 200 but withouta positive result. I have never used the HACS integration nor was I able to find it.

But it worked without before, for some odd reason it does not at this moment.
Maybe my next step would be the factory reset of the KLF200. I am afraid to do that because then I would have to re-integrate the 3 blinds as well.Any ideas?

My experience has been that you have to power cycle the Velux and then restart HA, and you may have to do this several times before it finally works. However here is another thread from a user experiencing the same issue after they upgraded.