PyVLX - controling VELUX windows with Python
============================================
[![CI](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml/badge.svg)](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)
PyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.
Installation
------------
PyVLX can be installed via:
```bash
pip3 install pyvlx
```
Home Assistant Plugin
---------------------
PyVLX is used within [Home Assistant](https://www.home-assistant.io/components/velux/). To enable it add the following lines to your ~/.homeassistant/configuration.yml:
```yaml
velux:
host: "192.168.0.0"
password: "1ADwl48dka"
```
*Please note that this uses the WiFi password, not the web login.*
For debugging frames add:
```yaml
logger:
default: warning
logs:
homeassistant.components.velux: debug
pyvlx: debug
```
Basic Operations
----------------
```python
"""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()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Julius2342/pyvlx",
"name": "pyvlx",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "",
"keywords": "velux KLF 200 home automation",
"author": "Julius Mittenzwei",
"author_email": "julius@mittenzwei.com",
"download_url": "https://files.pythonhosted.org/packages/fe/90/e5bb5bf13a518fc903e8f9505aca1f08ca5cb4e755ee8b6f007b59bfef38/pyvlx-0.2.23.tar.gz",
"platform": null,
"description": "PyVLX - controling VELUX windows with Python\n============================================\n\n[![CI](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml/badge.svg)](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)\n\nPyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.\n\nInstallation\n------------\n\nPyVLX can be installed via:\n\n```bash\npip3 install pyvlx\n```\n\nHome Assistant Plugin\n---------------------\n\nPyVLX is used within [Home Assistant](https://www.home-assistant.io/components/velux/). To enable it add the following lines to your ~/.homeassistant/configuration.yml:\n\n```yaml\nvelux:\n host: \"192.168.0.0\"\n password: \"1ADwl48dka\"\n```\n\n*Please note that this uses the WiFi password, not the web login.*\n\nFor debugging frames add:\n\n```yaml\nlogger:\n default: warning\n logs:\n homeassistant.components.velux: debug\n pyvlx: debug\n```\n\n\nBasic Operations\n----------------\n\n```python\n\"\"\"Just a demo of the new PyVLX module.\"\"\"\nimport asyncio\nfrom pyvlx import PyVLX, Position\n\n\nasync def main(loop):\n \"\"\"Demonstrate functionality of PyVLX.\"\"\"\n pyvlx = PyVLX('pyvlx.yaml', loop=loop)\n # Alternative:\n # pyvlx = PyVLX(host=\"192.168.2.127\", password=\"velux123\", loop=loop)\n\n # Runing scenes:\n await pyvlx.load_scenes()\n await pyvlx.scenes[\"All Windows Closed\"].run()\n\n # Changing position of windows:\n await pyvlx.load_nodes()\n await pyvlx.nodes['Bath'].open()\n await pyvlx.nodes['Bath'].close()\n await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))\n\n # Read limits of windows\n # limit = await pyvlx.nodes['Bath'].get_limitation()\n # limit.min_value\n # limit.max_value\n \n # Changing of on-off switches:\n # await pyvlx.nodes['CoffeeMaker'].set_on()\n # await pyvlx.nodes['CoffeeMaker'].set_off()\n\n # You can easily rename nodes:\n # await pyvlx.nodes[\"Window 10\"].rename(\"Window 11\")\n \n await pyvlx.disconnect()\n\nif __name__ == '__main__':\n # pylint: disable=invalid-name\n LOOP = asyncio.get_event_loop()\n LOOP.run_until_complete(main(LOOP))\n # LOOP.run_forever()\n LOOP.close()\n```\n",
"bugtrack_url": null,
"license": "LGPL",
"summary": "PyVLX is a wrapper for the Velux KLF 200 API. PyVLX enables you to run scenes and or open and close velux windows.",
"version": "0.2.23",
"project_urls": {
"Download": "https://github.com/Julius2342/pyvlx/archive/0.2.23.zip",
"Homepage": "https://github.com/Julius2342/pyvlx"
},
"split_keywords": [
"velux",
"klf",
"200",
"home",
"automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe90e5bb5bf13a518fc903e8f9505aca1f08ca5cb4e755ee8b6f007b59bfef38",
"md5": "194d59f30ec532adb398939c5dd5317d",
"sha256": "fed93423aa8d14fc2db5a880122a07f9850b16f2254dca10816e6091a73a2fc0"
},
"downloads": -1,
"filename": "pyvlx-0.2.23.tar.gz",
"has_sig": false,
"md5_digest": "194d59f30ec532adb398939c5dd5317d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 51130,
"upload_time": "2024-03-06T15:31:46",
"upload_time_iso_8601": "2024-03-06T15:31:46.479916Z",
"url": "https://files.pythonhosted.org/packages/fe/90/e5bb5bf13a518fc903e8f9505aca1f08ca5cb4e755ee8b6f007b59bfef38/pyvlx-0.2.23.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-06 15:31:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Julius2342",
"github_project": "pyvlx",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "pyvlx"
}