skillfed

pyotgw

A library to interface with the opentherm gateway through serial or network connection.

pyotgw v2.2.3 73.6K downloads/30d#14,970 on PyPI28
Copyleft license GPLv3+ Active released

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 pyotgw

uv

uv add pyotgw

poetry

poetry add pyotgw

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Topic :: Software Development :: Libraries

Tags

opentherm gateway pythonserial heating system controlboiler thermostat interfaceopentherm protocol libraryhome automation heatingotgw python clientcentral heating control
home-automationhardware-interfaceasync-io

More Libraries packages