Announcement

Collapse
No announcement yet.

Velux Integra KLF200 control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Velux Integra KLF200 control

    I have Velux Integra solar-powered roof awnings and a KLF200 controller which communicates with them.

    The following scripts allow me to control the awnings through HomeSeer devices (which I then use to do a bunch of scheduling and sunshine/weather related scripting).

    To link the HomeSeer and Velux devices, they must have the same name as seen in the HomeSeer and Velux web interfaces.

    velux-common.vb

    common functions for Velux KLF200 - included by the other scripts

    velux-device.vb

    Does the positioning when required. Set an event so this is called when the HomeSeer device changes. It takes three parameters (comma separated) - KLF200 IP address, password, and the device reference.
    e.g.
    192.168.0.30,password,252

    Click image for larger version  Name:	device-event.png Views:	0 Size:	261.6 KB ID:	1412384

    velux-check.vb

    Checks the Velux positions against HomeSeer devices and updates HomeSeer if necessary (e.g. if you used the manual controls). Set an event to call this every 15 minutes, it takes 3 or more parameters - KLF200 IP address, password, and device references of all Velux devices.
    e.g.
    192.168.0.30,password,252,253,289

    I have my devices set up like this:

    Click image for larger version  Name:	awning-device-setup.png Views:	0 Size:	322.9 KB ID:	1412385
    The icons are also attached.

    It has ONLY been tested with roof awnings - if you have any other devices I'd be interested to see the debug output, you can get this by editing velux-common.vb and setting "debug = true" near the end. Output goes to the log and shows the data of the commands sent and received.
    Last edited by rge; September 13, 2020, 02:36 AM. Reason: added note that HS & Velux devices are linked by having the same name

    #2
    Wow. This sounds awesome. I will try to adapt it to my skylights and shades. I may have to ask you for help!!

    Thanks so much for sharing!!

    JimO.

    Comment


      #3
      rge, after spending many hours getting Node Red, HS4 and the KLF200 to play, I tripped across this message and looks very interesting and simpler to implement. Less complexity to break. Looking at your script, it looks like the key to syncing the HS Virtual Velux Device and the nodeID in the KLF200, is the names need to match. Am I reading this correctly? I'm not a software guy :-)

      The icons are also awesome, was looking to create some earlier today as I'm using the Window open/closed at the moment.

      Nice work!

      Comment


        #4
        Exactly, it uses the names of the Velux and HomeSeer devices to match them. After it finds a match it updates the "address" field in the HS device so it doesn't have to do it again - so using the old HS3 /deviceutility page you can see e.g. my "Landing awning" is device 0 on the Velux:

        Click image for larger version

Name:	Capture.PNG
Views:	608
Size:	26.7 KB
ID:	1418889

        I'll update the instructions to make this clear.

        Comment


          #5
          May I ask about your experience with the KLF 200?

          I just had some Velux skylights installed and purchased the KLF 200. I find the unit quite flaky. Simply controlling it by wire touching or with mimolites, the white light will flash on the KLF but most times nothing happens with the windows its supposed to control. Sometimes rebooting it (via power cut) before attempting to control things helps, most times not.

          Have you found the KLF 200 to be reliable?

          Comment


            #6
            Not sure who the question was directed at, however mine has been fine, if doesn't get used a huge amount, some days not at all, other days quite a bit, especially when I'm tinkering around. So far it just works. Will keep an eye on the Node Red debugs to see if the KLF goes away when I'm not looking. Note: I only used the wire i/p via an Arduino with relay board for a very short period. Mine is now just a LAN > io-control gateway. Also just switched it over from its wall PSU, to a micro USB PoE splitter to power it from my network switch. Neater install and should it lock up I can reset it remotely.

            Comment


              #7
              Most recent copy of scripts attached - now confirmed working with roof awnings, blinds and window openers.

              Have improved the stability of connection handling and timeouts, so much less chance of the KLF200 getting stuck on two connections.

              Also included status icons for blinds/awnings and windows.
              Attached Files

              Comment


                #8
                I know this is quite an old thread, but I have just come across it! It's probably me, but I can't see how to control the devices - If I want to open a Window or close a blind, what is the command I would need?

                Comment


                  #9
                  If there's sufficient interest in Velux plugin, I could create it

                  https://shop.homeseer.com/search?typ...uct&q=alexbk66

                  Comment


                    #10
                    Originally posted by ScottRennie View Post
                    I know this is quite an old thread, but I have just come across it! It's probably me, but I can't see how to control the devices - If I want to open a Window or close a blind, what is the command I would need?
                    I just had to go through re-setting up a KLF 200 as my original one died. Velux replaced it under warranty, but I needed to set everything up again (pita - had to reset the windows and shades as they cannot bind to more than one two-way device.)

                    In the past I was using a stack of Fortrezz mimolites via the momentary switch wiring on the KLF to trigger open/close. This time I wanted to avoid using the mimolites, since they often required that I powercycle the KLF in order for them to work.

                    So after an entire weekend of f*&king around, here's what worked:
                    1) I paired all the devices (four windows, two blinds) with the KLF 200.
                    2) In the interface of the KLF I recorded a few programs to position the various windows and blinds. Worth noting that the interface for creating programs is a disaster, with confusing progress bars and a lack of good feedback. Trust that it's working even though it looks like it's stuck.
                    3) These programs are named things like "Loft_Open", "Loft_Close", etc.
                    4) On the Homeseer PC I borrowed and modified a python script that uses the pyvlx library, replacing the scene (program) names with the ones I created.
                    5) These scripts are called via the "Run Another Program" event in homeseer: e.g. "Launch /pyscripts/loft_open.py"
                    6) There is one script per program/scene.

                    As I'd already installed python on the HSPC for other purposes, this required only installing the new library. And now I have four mimolites to use elsewhere.

                    Downside is that I use virtual HS devices to track the state of the Velux devices, but don't read those values directly from the KLF. I assume that if I run a program/scene, the devices respond as intended. I think there is a way to use PyVlx to read state, but I don't bother. It works very reliably as is.

                    The python script looks like:

                    import asyncio
                    from pyvlx import PyVLX, Position

                    async def main(loop):

                    pyvlx = PyVLX(host="your KLF IP Address here", password="your_klf_wifi_password_here", loop=loop)
                    await pyvlx.load_scenes()
                    await pyvlx.scenes["YOUR_SCENE_NAME_HERE"].run()

                    await pyvlx.disconnect()

                    if __name__ == '__main__':
                    LOOP=asyncio.get_event_loop()
                    LOOP.run_until_complete(main(LOOP))
                    LOOP.close()

                    Comment


                      #11
                      Originally posted by alexbk66 View Post
                      If there's sufficient interest in Velux plugin, I could create it

                      https://shop.homeseer.com/search?typ...uct&q=alexbk66
                      Hi Alex - I would certainly be happy to pay for a plug-in. I currently use momentary relays which work, but I would really like the feedback from the blind or Window that the command has completed and the current status of the device (open/closed up/down etc.)

                      Cheers
                      Scott

                      Comment


                        #12
                        How are you controlling your velux with relays? I've been thinking of doing this with a dry contact closure device and my spare remote. Just looked at the price of the KFL200 and at $650 for my one skylight and blind, it's kinda hard to justify.
                        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                        Comment


                          #13
                          Originally posted by langenet View Post
                          How are you controlling your velux with relays? I've been thinking of doing this with a dry contact closure device and my spare remote. Just looked at the price of the KFL200 and at $650 for my one skylight and blind, it's kinda hard to justify.
                          Probably opening/closing can be achieved with Bond Bridge https://forums.homeseer.com/forum/hs...ig-screenshots, but it doesn't provide position feedback.

                          Comment


                            #14
                            Originally posted by langenet View Post
                            How are you controlling your velux with relays? I've been thinking of doing this with a dry contact closure device and my spare remote. Just looked at the price of the KFL200 and at $650 for my one skylight and blind, it's kinda hard to justify.
                            I'm using the relays along with a KLF200. I can get KLF200 for about £130 (British pounds) in the UK

                            Comment


                              #15
                              The KLF 200 in the US is around $300, not cheap, but allows HA integration. RGE vbs script worked very well and uses the API to talk over the LAN and control the devices.
                              Using the API allows much more granular control and feedback of current open state. Relays from what I found needed timing loops to judge how open or closed and no feedback . Unless you just want open/close which was simple.

                              Due to other integration I went the Node Red route and that has a Velux node that you can send commands to open and close with a value between 0 and 100% with two decimal places if you want. i.e. 41.18% This is very similar to RGE script, however I needed logic for the suns position (Solar Noon) and that started me on the path with Node Red and HS4.
                              Has been working well for over a year ventilating the house during the day.

                              Setting up the automation is pretty straight forward, getting the devices registered with the KLF as HSAccord states is a PIA. See KLF Setup


                              Comment

                              Working...
                              X