core icon indicating copy to clipboard operation
core copied to clipboard

Velux Integration shows an integration failure after reboot

Open MathiasB112 opened this issue 2 months ago • 5 comments

The problem

Hi, I added the Velux Integration to my Home Assisant. But after I reboot home assistant the Velux Hub can not be reached and it says Integration failure. I can only solve this problem by deleting an reintegrating the velux hub

What version of Home Assistant Core has the issue?

2025.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Velux

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.config_entries Quelle: config_entries.py:761 Erstmals aufgetreten: 19:57:07 (4 Vorkommnisse) Zuletzt protokolliert: 20:11:22 Error setting up entry 192.168.2.235 for velux

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 761, in __async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/velux/init.py", line 22, in async_setup_entry await pyvlx.load_scenes() File "/usr/local/lib/python3.13/site-packages/pyvlx/pyvlx.py", line 119, in load_scenes await self.scenes.load() File "/usr/local/lib/python3.13/site-packages/pyvlx/scenes.py", line 56, in load await get_scene_list.do_api_call() File "/usr/local/lib/python3.13/site-packages/pyvlx/api/api_event.py", line 29, in do_api_call await self.pyvlx.check_connected() File "/usr/local/lib/python3.13/site-packages/pyvlx/pyvlx.py", line 90, in check_connected await self.connect() File "/usr/local/lib/python3.13/site-packages/pyvlx/pyvlx.py", line 58, in connect await self.connection.connect() File "/usr/local/lib/python3.13/site-packages/pyvlx/connection.py", line 114, in connect self.transport, _ = await self.loop.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<4 lines>... ) ^ File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1171, in create_connection raise exceptions[0] File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1146, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ exceptions, addrinfo, laddr_infos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/asyncio/base_events.py", line 1045, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 641, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 681, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('192.168.2.235', 51200)

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

MathiasB112 avatar Nov 14 '25 19:11 MathiasB112

Hey there @julius2342, @deermaximum, @pawlizio, @wollew, mind taking a look at this issue as it has been labeled with an integration (velux) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of velux can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign velux Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


velux documentation velux source (message by IssueLinks)

home-assistant[bot] avatar Nov 14 '25 19:11 home-assistant[bot]

This looks like the "normal" behaviour of the KLF200, which does not handle being disconnected from without also being restarted. This is why HA initiates a reboot of the KLF200 before a normal HA restart. If the gateway reboot does not happen, the only way to get the gateway to accept connections again is usually to power-cycle it. This brings up the following questions:

  1. How did/do you reboot your HA? If you just reboot the machine, is there a chance that HA does not have enough time to properly shut down and reboot the KLF200?
  2. Are you sure that removing and re-adding the integration was the only thing you did, or was there a restart of the gateway involved?
  3. Have you tried reloading the integration?
  4. Can you provide debug logs of the velux integration from an HA restart, including the shutdown?

wollew avatar Nov 15 '25 07:11 wollew

Hi, ok I didn't know that...

Ref 1. : After some .yaml changes I just reboote my HA by clicking on reboot. I did not shut it down the "hard" way.

Ref 2. : Deleting and Adding is possible without power cycling my KLF 200

Ref 3. : Yes I did, it didn't work

Ref 4.: Yes I can.. But It take some time. The installation is at my parents house and I can not power cycle the KLF via the Internet

MathiasB112 avatar Nov 16 '25 21:11 MathiasB112

1+2+3 all sound like this is not the usual KLF200 problem, because a clean shutdown should not always lead to a working integration after HA startup, if deleting and adding works then reload should as well. So in essence, I am very much looking forward to seeing the logs for this. But of course I understand this can take some time.

wollew avatar Nov 17 '25 21:11 wollew

I use an automation to restart KLF200 at HA start, and it still works. My YAML:

description: Reboots the KLF200 in order to avoid SSL Handshake issue
mode: single
triggers:
  - event: shutdown
    trigger: homeassistant
conditions: []
actions:
  - data: {}
    action: velux.reboot_gateway

frontside76 avatar Dec 10 '25 06:12 frontside76