Skip to main content

trovis-modbus

CI PyPI Python License

[!IMPORTANT] Additional documentation and contributor instructions are available in the project wiki.

trovis-modbus is an asynchronous Python library for reading and writing Samson TROVIS 557x heating controllers over Modbus.

The library is backend-neutral: it consumes a modbus_connection.ModbusUnit and does not create or own the transport itself. Applications may therefore use tmodbus, pymodbus, or another backend supported by modbus-connection.

The Home Assistant integration is maintained separately in trovis-modbus-hass.

Features

  • Object-oriented access to controller, sensor, heating-circuit, hot-water, and clock data
  • Automatic controller-model probe and physical-sensor detection
  • Conservative model-specific register and coil profiles
  • Grouped, range-aware reads with a maximum span of 50 registers or coils
  • Read and write support with TROVIS write-access handling
  • Field-specific validation and TROVIS-specific write preconditions
  • Neutral metadata for units, limits, steps, enums, value types, and writable state
  • Complete operating-mode and control-level modelling
  • Native Python date and time values plus year-independent MonthDay values
  • Operational status values for heating circuits and domestic hot water
  • Derived plant activity and hot-water temperature ranges
  • Central handling of scaling, signed values, and TROVIS invalid-value sentinels

Supported model profiles

Models Heating circuits Register and coil profile
TROVIS 5573, 5573-1, 5575, 5576 2 TROVIS 5573 Rev. 2.54
TROVIS 5578, 5578-E, 5579 3 TROVIS 5578 Rev. 2.62 final

Known gaps and manufacturer block boundaries are preserved. Reads are never planned across those boundaries.

Device structure

A Trovis557x object exposes the following subsystems:

Attribute Description
info Model, firmware, hardware version, and serial information
controller Controller-wide status and settings
clock Native controller date and time
sensors Physical temperature, analog, pulse, and remote-control inputs
heating_circuit_1 Heating circuit Rk1
heating_circuit_2 Heating circuit Rk2
heating_circuit_3 Heating circuit Rk3 on supported models
hot_water Domestic-hot-water circuit Rk4
activity Combined heating and hot-water activity

device.heating_circuits contains only the heating circuits supported by the detected model.

Basic usage

Install the library together with the desired modbus-connection backend. This example uses tmodbus and transparent RTU over TCP:

import asyncio

from modbus_connection.tmodbus import connect_tcp
from trovis_modbus import Trovis557x


async def main() -> None:
    connection = await connect_tcp(
        "192.168.1.50",
        port=502,
        framer="rtu",
    )

    try:
        unit = connection.for_unit(246)
        probe = await Trovis557x.async_probe(unit)

        device = Trovis557x(
            unit,
            model=probe.model,
            detected_sensors=probe.detected_sensors,
        )

        await device.async_update()
        print("Model:", device.model)
        print("Outside temperature:", device.sensors.af1)
        print("Controller date:", device.clock.date)
        print("Plant activity:", device.activity)

        await device.async_enable_writing()
        try:
            await device.heating_circuit_1.set_room_setpoint_day(21.5)
        finally:
            await device.async_disable_writing()
    finally:
        await connection.close()


asyncio.run(main())

For native Modbus TCP with MBAP framing, use framer="socket". Serial transports are opened through the selected backend.

Metadata and writes

The library is the source of truth for neutral TROVIS datapoint metadata, including register or coil reference, scaling, unit, limits, step, enum options, invalid values, and writable state.

Generic writes use:

await component.async_write_datapoint(field, value)

The library refreshes TROVIS write access, validates the value, and performs required device-specific preconditions before writing.

Catalog definitions use manufacturer references such as HR40145 and CL137. Conversion to zero-based Modbus addresses is centralized in the library.

Command-line query tool

The repository contains script/query.py for querying a controller without Home Assistant.

python -m pip install -e ".[cli]"
python script/query.py tcp 192.168.1.50 --unit 246
python script/query.py serial /dev/ttyUSB0 --unit 246

Use --framer rtu for transparent RTU over TCP or --framer socket for native Modbus TCP.

Development and tests

Using uv:

uv sync
uv run pytest
uvx prek run --all-files

Alternatively, install the project in editable mode and use the repository scripts:

python -m pip install -e .
script/libtest.sh
script/libcheck.sh
  • libtest.sh runs the pytest suite with the modbus-connection mock backend.
  • libcheck.sh checks Ruff formatting and linting, compiles the sources, runs the tests, and builds the source distribution and wheel.

No physical controller or external Modbus server is required for the normal unit tests. Details about the local modbus-connection checkout, development branches, and contribution workflow are documented in the project wiki.

Release files for trovis-modbus 1.1.1

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

Source distribution (sdist)

Source distribution for trovis-modbus 1.1.1
File Size Uploaded
trovis_modbus-1.1.1.tar.gz 51.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trovis-modbus 1.1.1
File Interpreter ABI Platform
trovis_modbus-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 84.5 kB

Release files / trovis_modbus-1.1.1.tar.gz

Download URL trovis_modbus-1.1.1.tar.gz
Size 51.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9e3b3f6cd1a916ebaa4f1e465499e93c6018a4fb17523c4b3d4cd1f8e21e8c98
BLAKE2b-256 checksum
How to use checksums
77c02229ff0f47eb65f0b2fbde7ce0626b9f2ed1ca6fe4618b1d38638f4696b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / trovis_modbus-1.1.1-py3-none-any.whl

Download URL trovis_modbus-1.1.1-py3-none-any.whl
Size 33.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c46c377c58f8479e68958fd1620d617133b537c31603663be144c9c6ddac42ef
BLAKE2b-256 checksum
How to use checksums
b06a220ecd815ea4c1caa17911fd65aba44b7363c042c2dc318c40360bc1943b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release history Release notifications | RSS feed

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

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