Skip to main content

PyVLX is a wrapper for the Velux KLF 200 API. PyVLX enables you to run scenes and or open and close velux windows.

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvlx-0.2.25.tar.gz (74.2 kB view details)

Uploaded Source

File details

Details for the file pyvlx-0.2.25.tar.gz.

File metadata

  • Download URL: pyvlx-0.2.25.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pyvlx-0.2.25.tar.gz
Algorithm Hash digest
SHA256 7b0ae5e6b55efa4a160c591a9b821586644a00d75ef291e68fcb03673f12ee5d
MD5 0a29ff4a4385077e43b5d6cfbbdbdf18
BLAKE2b-256 af9b6eb2950e889efe6d5b240f28950e432b26e169c913fe6059ebd85d1c0fda

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page