Skip to main content

Automate wireless communication to UVR1611 via BL-NET

Project description

PyBLNET - a very basic python BL-NET bridge

Build Status Coverage Status

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyBLNET-0.9.2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyBLNET-0.9.2-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file PyBLNET-0.9.2.tar.gz.

File metadata

  • Download URL: PyBLNET-0.9.2.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for PyBLNET-0.9.2.tar.gz
Algorithm Hash digest
SHA256 568ccf0ff8bb1a3054b2214c7f4de9866282b36b47048f1c29ea01a3b9a4afc6
MD5 836ed2bc1eaa0e2566014c2c45fec0bf
BLAKE2b-256 f5eedd697373ec9c0452781e7334d3b649744c466bfa8c3ebbdd505f37b007eb

See more details on using hashes here.

File details

Details for the file PyBLNET-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: PyBLNET-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for PyBLNET-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 406baead435fe60c458d889a1317aed34350206e377b0d07ae3ed5aa60b06615
MD5 17273e2eb2a64b9cf43cf22f06998acb
BLAKE2b-256 a894e1d731a28d1bf87035ccdeff4098f54d2bbe747330ec023068ea6f39e30e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page