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 blnet_test, BLNET, BLNETWeb, BLNETDirect

ip = '192.168.178.10'

# Check if there is a blnet at given address
blnet_test(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.10.0.tar.gz (30.3 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.10.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pyblnet-0.10.0.tar.gz.

File metadata

  • Download URL: pyblnet-0.10.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for pyblnet-0.10.0.tar.gz
Algorithm Hash digest
SHA256 bfb900f6123803a81a9c9c6297585d764b5123413ca0dff6ce113bcd0cd26299
MD5 c50f3e959535c39503e9c25c02fd2914
BLAKE2b-256 2892a1a6c4c9ab351d82c98caa033b40de9dc6da604b90b82ece5301c912f107

See more details on using hashes here.

File details

Details for the file pyblnet-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: pyblnet-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for pyblnet-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b11d3f2e620f71b51fa55025d7e83b4784ed2e80d6aca3117290a1f6b44c07
MD5 3f700d0980ab6bcd06a079806eae617e
BLAKE2b-256 92407fb8646bddc956f3c115cb347ba8e45514db985c3f28f4ca916becd58468

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