Skip to main content

Python driver for Huber recirculating baths.

Project description

huber

Ethernet driver and command-line tool for Huber baths.

Installation

pip install huber

Usage

Command Line

For basic tasks, this driver includes a command-line interface. Read the help for more.

huber --help

Python

For more complex projects, use python to automate your workflow. This driver solely uses asynchronous Python ≥3.5.

import asyncio
from huber import Bath

async def get():
    async with Bath('192.168.1.100') as bath:
        print(await bath.get())

asyncio.run(get())

If the bath is communicating, this should print a dictionary of the form:

{
    'on': False,               # Temperature control (+pump) active
    'temperature': {
        'bath': 23.49,         # Internal (bath) temperature, °C
        'setpoint': 20.0       # Temperature setpoint, °C
    },
    'pump': {
        'pressure': 0.0,       # Pump head pressure, mbar
        'speed': 0,            # Pump speed, rpm
        'setpoint': 0          # Pump speed setpoint, rpm
    },
    'status': {
        'circulating': False,  # True if device is circulating
        'controlling': False,  # True if temperature control is active
        'error': False,        # True if an uncleared error is present
        'pumping': False,      # True if pump is on
        'warning': False       # True if an uncleared warning is present
    },
    'fill': 0.0,               # Oil level, [0, 1]
    'maintenance': 338,        # Time until maintenance alarm, days
    'warning': {               # Only present if warning is detected
        'code': -1,
        'condition': '',
        'recovery': '',
        'type': ''
    },
    'error': {                 # Only present if error is detected
        'code': -1,
        'condition': '',
        'recovery': '',
        'type': ''
    }
}

The main get method strings together multiple TCP requests, and can take >0.5s to run. If you don't want all the data, you should instead use the following:

await bath.get_setpoint()             # °C
await bath.get_bath_temperature()     # °C
await bath.get_process_temperature()  # °C (optionally installed)
await bath.get_pressure()             # mbar
await bath.get_pump_speed()           # rpm
await bath.get_fill_level()           # [0, 1]
await bath.get_next_maintenance()     # days
await bath.get_status()               # boolean dictionary
await bath.get_warning()              # None or dictionary
await bath.get_error()                # None or dictionary

You can also start, stop, set temperature setpoint, and set pump speed.

await bath.start()
await bath.stop()
await bath.set_setpoint(50)      # °C
await bath.set_pump_speed(2000)  # rpm
await bath.clear_warning()
await bath.clear_error()

Implementation

This uses the PB method described in the manual. Note that this does not take advantage of the PB package commands, which would cut down on the data transmission at the cost of extra bath configuration. This also does not take advantage of the high-accuracy PB data transmission, as its resolution is unnecessary in most use cases.

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

huber-0.8.1.tar.gz (56.1 kB view details)

Uploaded Source

Built Distribution

huber-0.8.1-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file huber-0.8.1.tar.gz.

File metadata

  • Download URL: huber-0.8.1.tar.gz
  • Upload date:
  • Size: 56.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for huber-0.8.1.tar.gz
Algorithm Hash digest
SHA256 0a430c2657486fe4aff3c5a8c8a9a15b0c0d28a11cd7ead8628669e3e37a9254
MD5 73d5a47713bc79b673aee3fa6a0ba24b
BLAKE2b-256 c69482eb07fd8bf53e8b2eca5a5096df74378730303772a95357a9b6f3c41169

See more details on using hashes here.

File details

Details for the file huber-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: huber-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for huber-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5444250d115e90520833ce9b710a5e6a3cb103aec153961cff0551249f557d1
MD5 7521cf36aa3d366e55f50d7c918770f6
BLAKE2b-256 7d34941b88fe069630844c7abbefe952fe9ed480192f27b69b99c0dd5d7d70ce

See more details on using hashes here.

Supported by

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