PyVLX - controling VELUX windows with Python
============================================
[](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": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "velux KLF 200 home automation",
"author": "Julius Mittenzwei",
"author_email": "julius@mittenzwei.com",
"download_url": "https://files.pythonhosted.org/packages/05/fa/c8ee9dc90590a513dc1bfd42c20f336bd0a8b99e81389cd42182a9f6eeb3/pyvlx-0.2.26.tar.gz",
"platform": null,
"description": "PyVLX - controling VELUX windows with Python\r\n============================================\r\n\r\n[](https://github.com/Julius2342/pyvlx/actions/workflows/ci.yml)\r\n\r\nPyVLX uses the Velux KLF 200 interface to control io-Homecontrol devices, e.g. Velux Windows.\r\n\r\nInstallation\r\n------------\r\n\r\nPyVLX can be installed via:\r\n\r\n```bash\r\npip3 install pyvlx\r\n```\r\n\r\nHome Assistant Plugin\r\n---------------------\r\n\r\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:\r\n\r\n```yaml\r\nvelux:\r\n host: \"192.168.0.0\"\r\n password: \"1ADwl48dka\"\r\n```\r\n\r\n*Please note that this uses the WiFi password, not the web login.*\r\n\r\nFor debugging frames add:\r\n\r\n```yaml\r\nlogger:\r\n default: warning\r\n logs:\r\n homeassistant.components.velux: debug\r\n pyvlx: debug\r\n```\r\n\r\n\r\nBasic Operations\r\n----------------\r\n\r\n```python\r\n\"\"\"Just a demo of the new PyVLX module.\"\"\"\r\nimport asyncio\r\nfrom pyvlx import PyVLX, Position\r\n\r\n\r\nasync def main(loop):\r\n \"\"\"Demonstrate functionality of PyVLX.\"\"\"\r\n pyvlx = PyVLX('pyvlx.yaml', loop=loop)\r\n # Alternative:\r\n # pyvlx = PyVLX(host=\"192.168.2.127\", password=\"velux123\", loop=loop)\r\n\r\n # Runing scenes:\r\n await pyvlx.load_scenes()\r\n await pyvlx.scenes[\"All Windows Closed\"].run()\r\n\r\n # Changing position of windows:\r\n await pyvlx.load_nodes()\r\n await pyvlx.nodes['Bath'].open()\r\n await pyvlx.nodes['Bath'].close()\r\n await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))\r\n\r\n # Read limits of windows\r\n # limit = await pyvlx.nodes['Bath'].get_limitation()\r\n # limit.min_value\r\n # limit.max_value\r\n \r\n # Changing of on-off switches:\r\n # await pyvlx.nodes['CoffeeMaker'].set_on()\r\n # await pyvlx.nodes['CoffeeMaker'].set_off()\r\n\r\n # You can easily rename nodes:\r\n # await pyvlx.nodes[\"Window 10\"].rename(\"Window 11\")\r\n \r\n await pyvlx.disconnect()\r\n\r\nif __name__ == '__main__':\r\n # pylint: disable=invalid-name\r\n LOOP = asyncio.get_event_loop()\r\n LOOP.run_until_complete(main(LOOP))\r\n # LOOP.run_forever()\r\n LOOP.close()\r\n```\r\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.26",
"project_urls": {
"Download": "https://github.com/Julius2342/pyvlx/archive/0.2.26.zip",
"Homepage": "https://github.com/Julius2342/pyvlx"
},
"split_keywords": [
"velux",
"klf",
"200",
"home",
"automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ef7cd45381c7db42615d6497853bbf7911a1b91ca7595b49c97acad4238aecc",
"md5": "1dc61f1054ddbbf3e0d83f9c6aea42c7",
"sha256": "4770e9445c31000ece801bd80cc0863e09e1c98ee8ab867f83d0a17aedb816a2"
},
"downloads": -1,
"filename": "pyvlx-0.2.26-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1dc61f1054ddbbf3e0d83f9c6aea42c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 86644,
"upload_time": "2024-12-29T00:44:41",
"upload_time_iso_8601": "2024-12-29T00:44:41.022162Z",
"url": "https://files.pythonhosted.org/packages/9e/f7/cd45381c7db42615d6497853bbf7911a1b91ca7595b49c97acad4238aecc/pyvlx-0.2.26-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "05fac8ee9dc90590a513dc1bfd42c20f336bd0a8b99e81389cd42182a9f6eeb3",
"md5": "a1bf53a86c3627b453b96bac4a8df403",
"sha256": "f689bad85e2e82c033fbc613ecbb414fd19498a1080de0636481fbdc777a429c"
},
"downloads": -1,
"filename": "pyvlx-0.2.26.tar.gz",
"has_sig": false,
"md5_digest": "a1bf53a86c3627b453b96bac4a8df403",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 51901,
"upload_time": "2024-12-29T00:44:42",
"upload_time_iso_8601": "2024-12-29T00:44:42.422410Z",
"url": "https://files.pythonhosted.org/packages/05/fa/c8ee9dc90590a513dc1bfd42c20f336bd0a8b99e81389cd42182a9f6eeb3/pyvlx-0.2.26.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-29 00:44:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Julius2342",
"github_project": "pyvlx",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "pyvlx"
}