pyotgw
A library to interface with the opentherm gateway through serial or network connection.
What it is and what it does
pyotgw is an async Python library that bridges your code to an OpenTherm Gateway device, a hardware interface for reading and controlling modern heating systems. It maintains a persistent connection to the gateway over serial or network, caches status information, and allows you to query boiler parameters, set control setpoints, and manage alternative data-IDs for unsupported features. The library was originally written for Home Assistant but works as a standalone tool for any heating system automation.
The core workflow is straightforward: instantiate an OpenThermGateway object, call connect() with your device port and optional timeout, then read cached status via methods like get_status() or subscribe to changes via callbacks. The library handles reconnection automatically if the gateway becomes unresponsive, and exposes methods to manipulate central heating enable bits and manage unsupported data-IDs. All operations are coroutines, so you integrate it into an async event loop.
Use it for:
- Integrate a heating system into a Home Assistant smart home setup for remote temperature control and monitoring
- Build a standalone daemon to log boiler parameters (flow temperature, pressure, flame status) to a database
- Automate heating schedules based on occupancy or weather data by setting control setpoints programmatically
- Monitor and alert on boiler faults or unusual operating conditions via the gateway's status reports
- Develop a custom thermostat UI that reads live heating data and sends commands to the boiler through the gateway
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyotgw is a Python library that communicates with an OpenTherm Gateway device over serial or network connection, allowing you to read and control heating system parameters asynchronously.
Yes. pyotgw is actively maintained, has no known vulnerabilities, low install friction, and is marked Production/Stable. Install it if you own an OpenTherm Gateway and need to control or monitor a compatible heating system from Python. The copyleft license is standard for this project type and poses no barrier for most users. The single dependency (pyserial-asyncio-fast) is lightweight and well-established.
Install
pyotgw on PyPI
pip
pip install pyotgwuv
uv add pyotgwpoetry
poetry add pyotgwInstalling pyotgw
Before you install
Low install friction with a single runtime dependency (pyserial-asyncio-fast). The package is actively maintained with recent commits and marked as Production/Stable. No known vulnerabilities.
License in practice
Licensed under GPLv3+, a copyleft license. Any derivative work or modification must be released under the same license terms, and source code must remain available.
Quickstart
import asyncio
from pyotgw import OpenThermGateway
async def main():
gateway = OpenThermGateway()
status = await gateway.connect('/dev/ttyUSB0', timeout=5)
print(status)
await gateway.disconnect()
asyncio.run(main())
Requires a physical OpenTherm Gateway device connected via serial port or network. Python 3.8 or later.
Verify before relying
- Whether the library fully supports all OpenTherm features or only those tested by the maintainer's hardware
- Performance characteristics under high-frequency polling or many concurrent subscriptions
Package facts
| License | GPLv3+ (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyserial-asyncio-fast |
| Maintenance | actively maintained — 196 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,585/month — #14,970 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyotgw-2.2.3-py3-none-any.whl
Keywords: opentherm, gateway, otgw
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyatagAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
python-tadoPyTado provides a Python interface to the Tado…
copyleft · top 15,000 on PyPI
simple-pidA dependency-free PID controller library that…
permissive · top 15,000 on PyPI
python-bsblanAsynchronous Python client for controlling and…
permissive · top 15,000 on PyPI
pymysensorsPython API for communicating with MySensors…
permissive · top 15,000 on PyPI
nexiaAsync Python library for controlling Nexia…
permissive · top 15,000 on PyPI
pypckpypck is an asynchronous Python library for…
permissive · top 15,000 on PyPI
myPyllantA Python library for interacting with the…
permissive · top 15,000 on PyPI
pyswitchbeeA Python library for controlling SwitchBee…
permissive · top 15,000 on PyPI
millheaterPython library to control Mill heater devices…
permissive · top 15,000 on PyPI