Velux Component for KLF 200 doesn't support the new API with Firmware 2.0.0.71

Of course not the one from my own WiFi, but the one used for configuring the KLF 200. (The web interface is no longer reachable on the LAN port.)

I was wondering. Is there any way to query the velux rain sensor using the new api?

It could be used to control other non velux specific devices. Eg. Awning blinds.

I just upgraded to 0.88 and the Velux Components came up perfectly. Thanks @Julius2342 for the great work.

I notice something a little odd. I have created a cover group like this.

cover:
  - platform: group
    name: "Family Room Window Shades"
    entities:
      - cover.family_room_shade_1
      - cover.family_room_shade_2
      - cover.family_room_shade_3
      - cover.family_room_shade_4
      - cover.family_room_shade_5
  - platform: group
    name: "Family Room Skylight Shades"
    entities:
      - cover.blind_1
      - cover.blind_2
      - cover.blind_3
      - cover.blind_4
      - cover.blind_5
      - cover.blind_6
      - cover.blind_7

Family Room Window Shades are Lutron shades.
Family Room Skylight Shades are the Velux ones.

When I open/close these groups the Lutron shades all move together. But the velux group does one shade at a time, waiting for it to completely close before starting the next one.

But its does not seem to be a velux limitation because I can quickly call each velux shade individually such that they are all closing together.

Any ideas? Should I be setting up the group differently?

I also recognized a similar behaviour. The problem is, that cover.set_position/open/close waits until the cover has reached the position.

May you try to patch the following:

--- a/pyvlx/opening_device.py
+++ b/pyvlx/opening_device.py
@@ -13,9 +13,9 @@ class OpeningDevice(Node):
     super().__init__(pyvlx=pyvlx, node_id=node_id, name=name)
     self.position = Position()

async def set_position(self, position):
     """Set window to desired position."""
-        command_send = CommandSend(pyvlx=self.pyvlx, node_id=self.node_id, parameter=position)
+        command_send = CommandSend(pyvlx=self.pyvlx, wait_for_completion=False, node_id=self.node_id, parameter=position)
         await command_send.do_api_call()
         if not command_send.success:
             raise PyVLXException("Unable to send command")

Yes, that does it.
It works for the shades and the opening windows.
Thanks!

I see a number of references in the source code to the rain sensor.
It seems to be available and loaded into the Window object

class Window(OpeningDevice):
“”“Window object.”“”

def __init__(self, pyvlx, node_id, name, rain_sensor=False):
    """Initialize Window class."""
    super().__init__(pyvlx=pyvlx, node_id=node_id, name=name)
    self.rain_sensor = rain_sensor

But it doesn’t seem to be exported as an attribute on the window entities.
Sorry, that’s the limit of my knowledge

I am still having issues after upgrading my KLF. I am currently on HA 0.88.2.

  • I’ve upgraded my Velux to 0.2.0.0.71.0 (my previous version was somewhere in the 0.1… area)
  • I’ve changed my password from velux123 to the Wifi password of the device

Unfortunately my Lovelace reports those as a platform that cannot be set up.

My log contains:

Log Details (ERROR)
Fri Mar 01 2019 12:16:39 GMT+0100 (CET)

Can't connect to velux interface: <PyVLXException description="Unable to login" /> Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/__init__.py", line 30, in async_setup await hass.data[DATA_VELUX].async_start() File "/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/__init__.py", line 56, in async_start await self.pyvlx.load_scenes() File "/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py", line 89, in load_scenes await self.scenes.load() File "/usr/local/lib/python3.7/site-packages/pyvlx/scenes.py", line 51, in load await get_scene_list.do_api_call() File "/usr/local/lib/python3.7/site-packages/pyvlx/api_event.py", line 22, in do_api_call await self.send_frame() File "/usr/local/lib/python3.7/site-packages/pyvlx/api_event.py", line 34, in send_frame await self.pyvlx.send_frame(self.request_frame()) File "/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py", line 72, in send_frame await self.connect() File "/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py", line 51, in connect raise PyVLXException("Unable to login") pyvlx.exception.PyVLXException: <PyVLXException description="Unable to login" />

Log Details (ERROR)
Fri Mar 01 2019 12:16:39 GMT+0100 (CET)

Setup failed for velux: Component failed to initialize.

Did my Velux HA Component not update correctly. Is there anything I can to to troubleshoot this?

regards,

Dominique

hi Dominique,

i had a similar issue on previous firmware version and was due to the fact KLF200 seems to accept only 1 connection at the time over ethernet.
I solved power cycling it.

Not sure if it is your case but it costs nothing to try.
Hope this helps

Thank you, i will try that. However, I am wondering what process is connecting to the KLF over LAN. There is no open port on the typical range.

Well, i‘ve restarted my Velux and I still cannot connect. Any ideas?

Hi, try these ideas

  1. Power cycle, and then connect to the WIFI access port it creates. Its only up for 10 or 15 minutes after a power cycle
  2. Connect to the web interface using the address and password on the back
  3. Good opportunity to sync your device off the Velux remotes.
  4. In the settings area check that the LAN port is not disabled!
  5. Try and ping the LAN port. Interesting thing here… My AUSUS wifi router never lists the Velux Hub in its connected device list (all other devices show up). I am not sure what magic is happening here, but its never listed. I had to manually use the LAN MAC on the back of the device, use it to set the DHCP server so I knew the IP (even then, not in the device list). After that it does return a ping. I can also ping it when its connected to HA.
  6. Then add the IP and password into HA and it should come up.

If any of this doesn’t work, do a factory reset, using a paper clip on the back and try again. Pull the user manual for the description, it seems unnecessarily complex! You have to hold it for about 10 seconds and then there is an LED sequence to confirm it worked. I needed to do this, to get things going.

I’ve had a similar problem, and after lots of head scratching and debugging I was surprised to realize that using ‘velux123’ instead of the Wifi password worked. Not sure if it’s the same issue here, but worth a try…

Neither the web password (velux123) nor the Wifi password is working. I am just wondering if there is anything I can do to troubleshot the configuration.

By the way, the old API access did work before I’ve flashed my KLF with the new firmware - even with the latest HA update.

It seems that the factory reset as suggested by jasebob would be the thing to do. I did everything else… even the device shows up in my Unfi network.

Hi,

It looks like Velux component is creating an issue to me.
I am on 0.89.1 and KLF200 correctly updated.

I put cover in GUI via Lovelace interface and renamed them (again via Lovelace) and…on HA reboot it didn’t load the frontend anymore.
I deleted HA database but didn’t work: only thing solved was to disable Velux component.

Now I don’t know what cause the issue: if this has something to do with Velux component itself or core.entity_registry which I read on the forum could cause similar issue: Link

Any idea how to dig more in it?

I finally bought the klf200 after using a hacked up remote control wires soldered on (esp8266 + web api).

Anyways… I see the same issues as you do.
I already miss my hacked up remote control API hehe.
Im on 0.89.1 and the web adm page of the klf unit works also. I imported the products etc etc.

2019-03-11 19:14:16 ERROR (MainThread) [homeassistant.components.velux] Can’t connect to velux interface:
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/init.py”, line 30, in async_setup
await hass.data[DATA_VELUX].async_start()
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/init.py”, line 56, in async_start
await self.pyvlx.load_scenes()
File “/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py”, line 87, in load_scenes
await self.scenes.load()
File “/usr/local/lib/python3.7/site-packages/pyvlx/scenes.py”, line 51, in load
await get_scene_list.do_api_call()
File “/usr/local/lib/python3.7/site-packages/pyvlx/api_event.py”, line 22, in do_api_call
await self.send_frame()
File “/usr/local/lib/python3.7/site-packages/pyvlx/api_event.py”, line 34, in send_frame
await self.pyvlx.send_frame(self.request_frame())
File “/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py”, line 70, in send_frame
await self.connect()
File “/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py”, line 49, in connect
raise PyVLXException(“Unable to login”)
pyvlx.exception.PyVLXException:

I swapped the web password “velux123” to the wifi password of the box… and then I am connected.

Another error thrown at me… But atleast now I see some progress.

[homeassistant.setup] Error during setup of component velux
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/setup.py”, line 151, in _async_setup_component
hass, processed_config)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/init.py”, line 30, in async_setup
await hass.data[DATA_VELUX].async_start()
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/velux/init.py”, line 57, in async_start
await self.pyvlx.load_nodes()
File “/usr/local/lib/python3.7/site-packages/pyvlx/pyvlx.py”, line 83, in load_nodes
await self.nodes.load(node_id)
File “/usr/local/lib/python3.7/site-packages/pyvlx/nodes.py”, line 70, in load
await self._load_all_nodes()
File “/usr/local/lib/python3.7/site-packages/pyvlx/nodes.py”, line 91, in _load_all_nodes
self.add(node)
File “/usr/local/lib/python3.7/site-packages/pyvlx/nodes.py”, line 54, in add
raise TypeError()
TypeError

So it looks like the issue I had, which was blocking hass, was due to KLF200.
I simply rebooted it, restarted hass and now all fine.

A bit scaring this component can hang up hass

Been having some issues where rebooting the hass.io device (for whatever reasons) would cause the subsequent velux connection to fail.

It doesnt happen always.
I can often reboot the hass.io device 4-5 times before it happens.

As you know, rebooting hass.io is mandatory when changing certain things within configuration.yaml - nothing to do with the velux component.

Im just grasping straws here… but could it have anything to do with the velux component not properly disposing its connection to klf200 when hass.io is told to reboot ?

I could easily think of a scenario where the klf 200 unit could not accept any more connections from the same host as would be the case if the previous connection was not properly terminated.

The fix is rebooting the klf 200 unit, as suspected.
but this is a bit tiresome :frowning:

In my case it is doing this every single time which is super annoying
Also this prevents a remote HASS reboot as if i do to this it doesn’t start anymore.

@balloob: I open an issue on GitHub but without having too much attention on it. Don’t you think it is an important one?
Sorry to bother naming directly: my doubt is you are not aware

Ive done a local fix here. Haven’t seen the issue since.
Let me know if you want to try it out.