PyBLNET


NamePyBLNET JSON
Version 0.9.3 PyPI version JSON
download
home_pagehttps://github.com/nielstron/pyblnet/
SummaryAutomate wireless communication to UVR1611 via BL-NET
upload_time2023-11-27 12:21:50
maintainer
docs_urlNone
authornielstron
requires_python>=3
licenseMIT
keywords python uvr1611 blnet technische alternative home automation iot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # PyBLNET - a very basic python BL-NET bridge
[![Build Status](https://app.travis-ci.com/nielstron/pyblnet.svg?branch=master)](https://app.travis-ci.com/github/nielstron/pyblnet)
[![Coverage Status](https://coveralls.io/repos/github/nielstron/pyblnet/badge.svg?branch=master)](https://coveralls.io/github/nielstron/pyblnet?branch=master)

A package that connects to the BL-NET that is connected itself to a UVR1611 device by Technische Alternative. 
It is able to read digital and analog values as well as to set switches to ON/OFF/AUTO.

Documentation on the modules and their methods can be found with the methods and modules themselves.

Two interfaces to BLNet exist and both are supported:
- Webinterface  - Class BLnetWeb
- BLNet-Direct protocol [1] - Class BLNETDirect

However, as of now, there is no testing on the BLNet-Direct protocol *of any kind*, so enabling it is discouraged until the interface is fixed.
Parsing the data via the web interface is the preferred way of accessing the BLNet for now.

The class BLNET is a wrapper around the two classes. When initializing the class, the two interfaces can be activated/deactivated. 
BLNetDirect provides 'analog', 'digital',  'speed', 'energy', 'power', whereas BLnetWeb supports 'analog' and 'digital' only.
If both are active, BLNetDirect has priority.
Setting switches and reading their manual/auto state is only possible via the BLNetWeb interface.

### Usage

```python
from pyblnet import test_blnet, BLNET, BLNETWeb, BLNETDirect

ip = '192.168.178.10'

# Check if there is a blnet at given address
test_blnet(ip) # -> True/False

# Convenient high level interface
blnet = BLNET(ip, password='pass', timeout=5)

# Control a switch by its ID
blnet.turn_on(10)
blnet.turn_auto(10)
blnet.turn_off(10)

# Fetch data (contains all available data using enabled interfaces)
print(blnet.fetch())



# The low level modules are also available
# note that the direct use of these modules is discouraged though

# Fetch the latest data via web interface
# Note that manual log in and log out are required
# when not using the with statement
with BLNETWeb(ip, password='pass', timeout=5) as blnet_session:
    print(blnet_session.read_analog_values())
    print(blnet_session.read_digital_values())

    # For publishing values
    blnet_session.set_digital_value('10', 'AUS')
    # Note that without explicit log out,
    # the BLNET will block any further web access for the next 150s
    # this is handled automatically when using the with statement

# Fetch data via the Protocol developed by TA
blnet = BLNETDirect(ip)
# Fetching the latest data
print(blnet.get_latest())
# Still inofficial because unexplicably failing often
print(blnet._get_data(1))
```


[1] https://www.haus-terra.at/heizung/download/Schnittstelle/Schnittstelle_PC_Bootloader.pdf

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nielstron/pyblnet/",
    "name": "PyBLNET",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "python uvr1611 blnet technische alternative home automation iot",
    "author": "nielstron",
    "author_email": "n.muendler@web.de",
    "download_url": "https://files.pythonhosted.org/packages/ec/fd/3be0532910d50bedb941ea7e34806345bac2b864feb02cdd2f17bf01a9bf/PyBLNET-0.9.3.tar.gz",
    "platform": null,
    "description": "# PyBLNET - a very basic python BL-NET bridge\n[![Build Status](https://app.travis-ci.com/nielstron/pyblnet.svg?branch=master)](https://app.travis-ci.com/github/nielstron/pyblnet)\n[![Coverage Status](https://coveralls.io/repos/github/nielstron/pyblnet/badge.svg?branch=master)](https://coveralls.io/github/nielstron/pyblnet?branch=master)\n\nA package that connects to the BL-NET that is connected itself to a UVR1611 device by Technische Alternative. \nIt is able to read digital and analog values as well as to set switches to ON/OFF/AUTO.\n\nDocumentation on the modules and their methods can be found with the methods and modules themselves.\n\nTwo interfaces to BLNet exist and both are supported:\n- Webinterface  - Class BLnetWeb\n- BLNet-Direct protocol [1] - Class BLNETDirect\n\nHowever, as of now, there is no testing on the BLNet-Direct protocol *of any kind*, so enabling it is discouraged until the interface is fixed.\nParsing the data via the web interface is the preferred way of accessing the BLNet for now.\n\nThe class BLNET is a wrapper around the two classes. When initializing the class, the two interfaces can be activated/deactivated. \nBLNetDirect provides 'analog', 'digital',  'speed', 'energy', 'power', whereas BLnetWeb supports 'analog' and 'digital' only.\nIf both are active, BLNetDirect has priority.\nSetting switches and reading their manual/auto state is only possible via the BLNetWeb interface.\n\n### Usage\n\n```python\nfrom pyblnet import test_blnet, BLNET, BLNETWeb, BLNETDirect\n\nip = '192.168.178.10'\n\n# Check if there is a blnet at given address\ntest_blnet(ip) # -> True/False\n\n# Convenient high level interface\nblnet = BLNET(ip, password='pass', timeout=5)\n\n# Control a switch by its ID\nblnet.turn_on(10)\nblnet.turn_auto(10)\nblnet.turn_off(10)\n\n# Fetch data (contains all available data using enabled interfaces)\nprint(blnet.fetch())\n\n\n\n# The low level modules are also available\n# note that the direct use of these modules is discouraged though\n\n# Fetch the latest data via web interface\n# Note that manual log in and log out are required\n# when not using the with statement\nwith BLNETWeb(ip, password='pass', timeout=5) as blnet_session:\n    print(blnet_session.read_analog_values())\n    print(blnet_session.read_digital_values())\n\n    # For publishing values\n    blnet_session.set_digital_value('10', 'AUS')\n    # Note that without explicit log out,\n    # the BLNET will block any further web access for the next 150s\n    # this is handled automatically when using the with statement\n\n# Fetch data via the Protocol developed by TA\nblnet = BLNETDirect(ip)\n# Fetching the latest data\nprint(blnet.get_latest())\n# Still inofficial because unexplicably failing often\nprint(blnet._get_data(1))\n```\n\n\n[1] https://www.haus-terra.at/heizung/download/Schnittstelle/Schnittstelle_PC_Bootloader.pdf\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Automate wireless communication to UVR1611 via BL-NET",
    "version": "0.9.3",
    "project_urls": {
        "Homepage": "https://github.com/nielstron/pyblnet/"
    },
    "split_keywords": [
        "python",
        "uvr1611",
        "blnet",
        "technische",
        "alternative",
        "home",
        "automation",
        "iot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a10f2666bb4f373e58264f6c2ea9c1548080781e8548d3cf52140b256be4453",
                "md5": "89c1a7f80fa0fff0bafdb07c648eeff5",
                "sha256": "b0bfa3443341a8a3a84c781be060882daf9b5e641a56f524ea34f3e27a809188"
            },
            "downloads": -1,
            "filename": "PyBLNET-0.9.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "89c1a7f80fa0fff0bafdb07c648eeff5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 34021,
            "upload_time": "2023-11-27T12:21:49",
            "upload_time_iso_8601": "2023-11-27T12:21:49.182012Z",
            "url": "https://files.pythonhosted.org/packages/6a/10/f2666bb4f373e58264f6c2ea9c1548080781e8548d3cf52140b256be4453/PyBLNET-0.9.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ecfd3be0532910d50bedb941ea7e34806345bac2b864feb02cdd2f17bf01a9bf",
                "md5": "d90d93da053678402fcff6b3ca4278b1",
                "sha256": "dcfa20df18c045bf07ac5a59eac96c9bd555fa262f8b511a464afe2386ae10b5"
            },
            "downloads": -1,
            "filename": "PyBLNET-0.9.3.tar.gz",
            "has_sig": false,
            "md5_digest": "d90d93da053678402fcff6b3ca4278b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 23970,
            "upload_time": "2023-11-27T12:21:50",
            "upload_time_iso_8601": "2023-11-27T12:21:50.962693Z",
            "url": "https://files.pythonhosted.org/packages/ec/fd/3be0532910d50bedb941ea7e34806345bac2b864feb02cdd2f17bf01a9bf/PyBLNET-0.9.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-27 12:21:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nielstron",
    "github_project": "pyblnet",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyblnet"
}
        
Elapsed time: 0.14649s