Skip to main content

watlow

Python driver and command-line tool for Watlow EZ-Zone temperature controllers.

Installation

pip install watlow

Usage

Command Line

$ watlow /dev/ttyUSB0

This returns a simple data structure.

{
  "actual": 21.66,
  "setpoint": 20.0,
  "output": 52.1
}

You can additionally use the --set-setpoint option to set a temperature setpoint.

If interacting with a Watlow RUI Gateway, the zone to get or set should be passed as a flag

$ watlow -z 1 192.168.1.101

See watlow --help for more.

Python

Single Controller

For a single temperature controller, the python interface is basic synchronous serial communication.

import watlow

tc = watlow.TemperatureController('/dev/ttyUSB0')

tc.set(30)
print(tc.get())

The driver is designed to be fault tolerant over long polling, and should appropriately reconnect if its IOErrors are managed. Here's an implementation with standard long-poll exception handling. This should run until interrupted and then exit cleanly.

from time import sleep
import watlow

tc = watlow.TemperatureController('/dev/ttyUSB0')
try:
    while True:
        try:
            print(tc.get())
        except IOError:
            print('disconnected')
        sleep(1)
except KeyboardInterrupt:
    pass
finally:
    tc.close()

Gateway

The Gateway driver uses Python ≥3.7's async/await syntax to asynchronously communicate with the gateway over ModBus-TCP.

import asyncio
import watlow

async def run():
    async with watlow.Gateway('192.168.1.101') as gateway:
        print(await gateway.get(1))

asyncio.run(run())

Additionally, there is a mock for the Gateway driver available at watlow.mock.Gateway for testing.

Download files

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

Source Distribution

watlow-0.6.3.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

watlow-0.6.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file watlow-0.6.3.tar.gz.

File metadata

  • Download URL: watlow-0.6.3.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for watlow-0.6.3.tar.gz
Algorithm Hash digest
SHA256 ca487760c368ef5bfaafea7c59c643a2ffc837ab2618093a192c0ec1c91639b0
MD5 86f870b4514ed2f4bf851b39bc76942d
BLAKE2b-256 616a27b3173009e3f3e4cb5706cad71a1d5d0b2bc826bea0420c228bee9a5c80

See more details on using hashes here.

File details

Details for the file watlow-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: watlow-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for watlow-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0fd4386dff479d24d3dd104b04121460848a9eeae58d754c9b5d4a2866f838e
MD5 b309c523b6ced3a905b7e8b7532aaaf4
BLAKE2b-256 3716d1cf31b987948748e594db7ddc333297e390a6d11e8ff2d53237cfd03148

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

This release

0.6.3 This release

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page