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

this one looks also nice : https://github.com/Deejayfool/hass-shutter-card

yes, I’ve tried this, but it doesn’t automatically scale and the skeuomorphic design may clash with other cards visually.
The vertical slider cover card can be used for shutters, blinds, windows, etc. And I had a few emails with the developer - he is very kind and made some quick improvements based on my suggestions :slight_smile:

That’s also important indeed

Hi

I just received my KLF 200 and I don’t manage do make it work. I have the error above in logs.

Do you have some idea to help me ?

:pray: :pray:

2020-07-18 00:13:35 WARNING (MainThread) [pyvlx] Connected to: KLF 200: Software version: 0.2.0.0.71.0, hardware version: 6, protocol version: 3.14
ValueError: 378 is not a valid NodeTypeWithSubtype

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 545, in data_received
    self._app_protocol.data_received(chunk)
  File "/usr/local/lib/python3.7/site-packages/pyvlx/connection.py", line 52, in data_received
    frame = frame_from_raw(raw)
  File "/usr/local/lib/python3.7/site-packages/pyvlx/frame_creation.py", line 40, in frame_from_raw
    frame.from_payload(payload)
  File "/usr/local/lib/python3.7/site-packages/pyvlx/frames/frame_get_all_nodes_information.py", line 127, in from_payload
    self.node_type = NodeTypeWithSubtype(payload[69] * 256 + payload[70])
  File "/usr/local/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/local/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/local/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))

ValueError: 378 is not a valid NodeTypeWithSubtype

2020-07-18 00:13:47 ERROR (MainThread) [homeassistant.components.velux] Can't connect to velux interface: <PyVLXException description="Unable to retrieve node information" />
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 31, in async_setup
    await hass.data[DATA_VELUX].async_start()
  File "/usr/src/homeassistant/homeassistant/components/velux/__init__.py", line 70, 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 88, in _load_all_nodes
    raise PyVLXException("Unable to retrieve node information")
pyvlx.exception.PyVLXException: <PyVLXException description="Unable to retrieve node information" />
2020-07-18 00:13:47 ERROR (MainThread) [homeassistant.setup] Setup failed for velux: Integration failed to initialize.

Did you try to power cycle the KLF200?

My velux are going to be installed in next week’s, do you always need to restart the klf if you restart HA? Cause of the limited time out connections?

no always, but sometimes you need.

I solved adding a cheap sonoff basic with which I can eventually power-cycle remotely the KLF200

Ok, I also have a spare zigbee switch

But is it needed cause of restart HA? Or just at random times? Cause I want automations for at night to open the velux and close in morning…

If it’s random , then I going to make a script to power cycle that switch every night…
Also , if you power cycle the klf, do you need to restart HA also?

Also, last question, do I also need the kux110 option if I bought the klf 200?

I found this here, and he described that you also need the kux110 if you buy a klf 200

Edit: nm, seems its for shutters, mine are connected to the Integra electrical windows, so don’t need the kux110

The good news, is that HA connected successfully to your KLF200.
My guess, looking at your LOGs and the API document, is that the KLF200 is reporting to HA about the devices the KLF200 controls and HA doesn’t know about these devices; or perhaps the KLF is reporting that it has 0 devices it controls. When you go into the KLF’s Web GUI, do you see any devices?

Ciao Fabio,

It is needed to power cycle klf200 random times…say 1 time every 10 you restart HA.
It mostly happen when you update HA actually which could be due to a not clean disconnections from klf200

Once HA is started and connected it is rock solid: I have quite few automations on Velux (Windows, covers, shades…) and they work beautifully

Ok, thx for info… Do you have somekind of sensor so you can actually see if klf is connected or not?.. So you can send somekind of notification… That way I can do an automation to power cycle the klf…

Or can you only see it in log files and restart HA?

I tried to unplug/replug it many times yes.

Hi,

I added 2 (garage door and a velux cover) before trying to connect the KLF200 to HA.
I have 4 devices in the KLF’s web GUI (1 cover, 1 garage door, 1 light associated to door and 1 on/off switch that seems to be the same than the light).

I took a glanced at the pyvlx.py code (which is what HA uses) along with your log.
The log says ValueError: 378 is not a valid NodeTypeWithSubtype
378 is x17A in hex. The API doc for that type says the following:

0x017A Linear or angular position of the garage door

The code NodeTypewithSubtype() itself has a list of “enum” items that it supports, and 0x017A is not in the list. There is however one that is close to it: LINAR_ANGULAR_POSITION_OF_GARAGE_DOOR = 0x140
To me this is a hint that the code actually supports a garage door similar to yours.

My recommendation would be to send the author of the pyvlyx.py code an email to see if he can add the 0x017A to the list.

Here is the project page, and at the bottom you’ll see the author’s contact.

If you know how to get to the code, it would be an easy change the 0x140 to an 0x17A, then just try it out.

See this interesting reply :

Hi @wmaker,

Thank you for your answer. I will open an issue on pyvlx github.
I not a python guy but I’m a developer. I can try some things directly in pyvlyx.py but I don’t find it :frowning:

I can’t access /usr/local/lib/python3.7/site-packages/pyvlx/nodes.py through ssh. python3.7 is not in /usr/local/lib/ folder.

Do you have any hint about it ?

I will also try to remove the garage door and just make sure the velux cover work.

I’ve only started playing around with Hassio recently as I mainly use HA Core.
I did manage to sorta hack into Hassio. Here is what I did:

You’ll want to get to the system’s “main hassOS console” (rather than the SSH addon). The “main hassOS console” gets you a login prompt (username root, no password), which gets you access to HA CLI, then enter “login” which will get you to a linux shell.
You will know you are at the right place if you enter $docker ps and you see a docker container named homeassistant.

Next enter $ docker exec -it homeassistant /bin/sh This will get you to a shell inside the homeassistant docker container. From here you should be able to get to the pyvlx files. Just be careful, as you’re inside a docker container. Make sure to make a backup of the file you’re modifying. Good Luck!

Guys, me velux were installed today
i have 2 windows (integra electrical)and also 2 sun protectors outside
some questions about setup for klf200 , i have it working though in HA , but i am not sure about setup

at the moment, the integra windows, the motor is not installed yet, so i am starting with the 2 sun protectors (electrical)

the left sun protector i have configured at input nr 3
the right sunprotector i have configured at input nr 4

questions
1)
according to manual , you need to configure a set of inputs?
so input 1 is for opening, input 2 for closing? but thats not needed? we only need 1 input for 1 sun protector? i have just followed manual, i press the reset button on my wall switch, i press the reset button on KLF … done
in HA, i can see my 2 covers created, and i can open / close them seperately

also second, the inputs with blue wires … do we need to configure them also? according to manual its ro receive the state … but i can see the state perfectly in HA if i close/open my sun protectors?