PyBLNET


NamePyBLNET JSON
Version 0.9.5 PyPI version JSON
download
home_pagehttps://github.com/nielstron/pyblnet/
SummaryAutomate wireless communication to UVR1611 via BL-NET
upload_time2024-10-31 20:54:54
maintainerNone
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 No Travis.
coveralls test coverage No coveralls.
            # PyBLNET - a very basic python BL-NET bridge
[![Build status](https://github.com/nielstron/pyblnet/actions/workflows/build.yml/badge.svg)](https://github.com/nielstron/pyblnet/actions/workflows/build.yml)
[![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": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "python uvr1611 blnet technische alternative home automation iot",
    "author": "nielstron",
    "author_email": "n.muendler@web.de",
    "download_url": "https://files.pythonhosted.org/packages/4c/0c/b536569855ec41bf06f4cbf1c9d13e37769e3b3c83b79e3d43524c51f003/PyBLNET-0.9.5.tar.gz",
    "platform": null,
    "description": "# PyBLNET - a very basic python BL-NET bridge\n[![Build status](https://github.com/nielstron/pyblnet/actions/workflows/build.yml/badge.svg)](https://github.com/nielstron/pyblnet/actions/workflows/build.yml)\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.5",
    "project_urls": {
        "Homepage": "https://github.com/nielstron/pyblnet/"
    },
    "split_keywords": [
        "python",
        "uvr1611",
        "blnet",
        "technische",
        "alternative",
        "home",
        "automation",
        "iot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7d5f8bd36d2c9929ab72053280d289b6903157e12a1fe029bd83f843fb552d6",
                "md5": "fce060d3043eaba447f9d53f05c086e9",
                "sha256": "b63f963218ec815c518f280ceb06760bd58f3dc100d7cde9633f91275e4e6845"
            },
            "downloads": -1,
            "filename": "PyBLNET-0.9.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fce060d3043eaba447f9d53f05c086e9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 34760,
            "upload_time": "2024-10-31T20:54:52",
            "upload_time_iso_8601": "2024-10-31T20:54:52.901270Z",
            "url": "https://files.pythonhosted.org/packages/d7/d5/f8bd36d2c9929ab72053280d289b6903157e12a1fe029bd83f843fb552d6/PyBLNET-0.9.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c0cb536569855ec41bf06f4cbf1c9d13e37769e3b3c83b79e3d43524c51f003",
                "md5": "f4f752a5a9ddd8500031f2270d5c0b6e",
                "sha256": "0fd0aeb31c828c97b2a209b44ab6096fd76dd3ddb9333fe901f4bcad761cb169"
            },
            "downloads": -1,
            "filename": "PyBLNET-0.9.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f4f752a5a9ddd8500031f2270d5c0b6e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 24463,
            "upload_time": "2024-10-31T20:54:54",
            "upload_time_iso_8601": "2024-10-31T20:54:54.151181Z",
            "url": "https://files.pythonhosted.org/packages/4c/0c/b536569855ec41bf06f4cbf1c9d13e37769e3b3c83b79e3d43524c51f003/PyBLNET-0.9.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-31 20:54:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nielstron",
    "github_project": "pyblnet",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyblnet"
}
        
Elapsed time: 1.02701s