Skip to content
forked from Julius2342/pyvlx

PyVLX - controling VELUX windows with Python via KLF 200

License

Notifications You must be signed in to change notification settings

dumpfheimer/pyvlx

This branch is 1 commit ahead of, 239 commits behind Julius2342/pyvlx:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c4cdf34 · Sep 29, 2022
Aug 6, 2021
Aug 6, 2021
Nov 24, 2018
Jul 2, 2022
Sep 29, 2022
Nov 24, 2021
Aug 17, 2017
Nov 24, 2018
Dec 23, 2018
Nov 15, 2021
Jun 24, 2017
May 22, 2020
Sep 17, 2021
Nov 23, 2018
Aug 3, 2020
Jan 10, 2022
Aug 6, 2021

Repository files navigation

PyVLX - controling VELUX windows with Python

CI

PyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.

Installation

PyVLX can be installed via:

pip3 install pyvlx

Home Assistant Plugin

PyVLX is used within Home Assistant. To enable it add the following lines to your ~/.homeassistant/configuration.yml:

velux:
    host: "192.168.0.0"
    password: "1ADwl48dka"

Please note that this uses the WiFi password, not the web login.

For debugging frames add:

logger:
  default: warning
  logs:
    homeassistant.components.velux: debug
    pyvlx: debug

Basic Operations

"""Just a demo of the new PyVLX module."""
import asyncio
from pyvlx import PyVLX, Position


async def main(loop):
    """Demonstrate functionality of PyVLX."""
    pyvlx = PyVLX('pyvlx.yaml', loop=loop)
    # Alternative:
    # pyvlx = PyVLX(host="192.168.2.127", password="velux123", loop=loop)

    # Runing scenes:
    await pyvlx.load_scenes()
    await pyvlx.scenes["All Windows Closed"].run()

    # Changing position of windows:
    await pyvlx.load_nodes()
    await pyvlx.nodes['Bath'].open()
    await pyvlx.nodes['Bath'].close()
    await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))

    # Read limits of windows
    # limit = await pyvlx.nodes['Bath'].get_limitation()
    # limit.min_value
    # limit.max_value
    
    # Changing of on-off switches:
    # await pyvlx.nodes['CoffeeMaker'].set_on()
    # await pyvlx.nodes['CoffeeMaker'].set_off()

    # You can easily rename nodes:
    # await pyvlx.nodes["Window 10"].rename("Window 11")
        
    await pyvlx.disconnect()

if __name__ == '__main__':
    # pylint: disable=invalid-name
    LOOP = asyncio.get_event_loop()
    LOOP.run_until_complete(main(LOOP))
    # LOOP.run_forever()
    LOOP.close()

About

PyVLX - controling VELUX windows with Python via KLF 200

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Makefile 0.2%