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/tipi85/pyvlx-tp85",
"name": "pyvlx-tp85",
"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/b5/37/cd613a640992a8899e47f679a58646fc1b0fce3b49ff9cd00e0b03a245dc/pyvlx-tp85-2.21.2.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. It enables run scenes, open, close windows. + SWINGING_SHUTTERS as ROLLER_SHUTTER",
"version": "2.21.2",
"project_urls": {
"Homepage": "https://github.com/tipi85/pyvlx-tp85"
},
"split_keywords": [
"velux",
"klf",
"200",
"home",
"automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f4da2478d7b4bda8986a00b80b2a4331244283c05c61da12e5685c50ce1a96a7",
"md5": "a16149e1aa900f93758767337fff9954",
"sha256": "e48221ae4a8c369652fc340af9ba25febee974c7fe69779cbf4fb14a605c57ca"
},
"downloads": -1,
"filename": "pyvlx_tp85-2.21.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a16149e1aa900f93758767337fff9954",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 85547,
"upload_time": "2024-02-22T17:51:53",
"upload_time_iso_8601": "2024-02-22T17:51:53.814014Z",
"url": "https://files.pythonhosted.org/packages/f4/da/2478d7b4bda8986a00b80b2a4331244283c05c61da12e5685c50ce1a96a7/pyvlx_tp85-2.21.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b537cd613a640992a8899e47f679a58646fc1b0fce3b49ff9cd00e0b03a245dc",
"md5": "ebb9a8df94f49eee290aa9db01c84203",
"sha256": "dfdd137ffa66b8160c45179583cdc145d233028de2627d131fc08a95418c9454"
},
"downloads": -1,
"filename": "pyvlx-tp85-2.21.2.tar.gz",
"has_sig": false,
"md5_digest": "ebb9a8df94f49eee290aa9db01c84203",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 51150,
"upload_time": "2024-02-22T17:51:56",
"upload_time_iso_8601": "2024-02-22T17:51:56.650710Z",
"url": "https://files.pythonhosted.org/packages/b5/37/cd613a640992a8899e47f679a58646fc1b0fce3b49ff9cd00e0b03a245dc/pyvlx-tp85-2.21.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 17:51:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tipi85",
"github_project": "pyvlx-tp85",
"github_not_found": true,
"lcname": "pyvlx-tp85"
}