Skip to main content

watlow

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

Installation

uv 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 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.

Metadata

Release files for watlow 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watlow 0.9.0
File Size Uploaded
watlow-0.9.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for watlow 0.9.0
File Interpreter ABI Platform
watlow-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / watlow-0.9.0.tar.gz

Download URL watlow-0.9.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
846c43d73a5d9c91096c052037f3b9730742fc977307f997f70c9d98e78b5d37
BLAKE2b-256 checksum
How to use checksums
c7510de1308c9792885a32655bf8e067b1a49f51138a8895e8eb44bcd0cd5aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / watlow-0.9.0-py3-none-any.whl

Download URL watlow-0.9.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
145399cbd8d720b661fc72c8c607d1b702b44e31c1586745867bb2f405b21ecc
BLAKE2b-256 checksum
How to use checksums
db41c7d74ddd072991174531f661ffde17cf53f6cae24604bd0e0c1bcc12e7c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release 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