Read a Samson Trovis 557x heating controller over Modbus.
Project description
trovis-modbus
A standalone Python library that reads a Samson Trovis 557x heating controller over Modbus, exposed as a normal, object-oriented Python API.
Addresses, scales and data types are taken from the canonical Trovis 557x point
list (the Tom-Bom-badil
SmartHomeNG plugin) and verified in tests against a vendored copy of that
table (tests/reference/canonical_points.json).
Design
-
It consumes the connection abstraction, not a backend: the API takes a
modbus_connection.ModbusUnitand reads/writes through it. You choose the backend (pymodbus, tmodbus, …). -
A
Trovis557xis a tree of independently-updatable sub-systems, each aComponentthat knows its own registers:Attribute What infomodel, firmware/hardware version, serial → DeviceInfocontrollerfaults, rotary switches, summer mode, frost limit, locks clockdate/time as native datetimeobjectssensorsevery temperature input (outside, flow, return, room, storage, remote) heating_circuit_1/_2/_3space-heating circuits (RK1-3) hot_waterdomestic hot water (HK4): setpoints, charging, disinfection -
Each sub-system can refresh on its own and has its own update listeners, so a single Home Assistant entity can subscribe to just the part it shows (e.g. one climate entity per heating circuit).
-
Units of measurement live in each property's docstring, not in the value.
Use
import asyncio
from modbus_connection.pymodbus import connect_tcp
from trovis_modbus import Trovis557x, OperatingMode
async def main() -> None:
conn = await connect_tcp("192.168.1.50", port=502)
try:
trovis = Trovis557x(conn.for_unit(1)) # unit 1 = the controller's Modbus address
await trovis.async_update()
print("Outside:", trovis.sensors.outside_1, "°C")
print("HK1 mode:", trovis.heating_circuit_1.mode)
print("HK1 target:", trovis.heating_circuit_1.room_setpoint_active, "°C")
print("HK1 pump:", trovis.heating_circuit_1.pump_running)
print("HK1 curve:", trovis.heating_circuit_1.heating_curve())
print("Hot water:", trovis.hot_water.setpoint_active, "charging:", trovis.hot_water.charge_pump_running)
print("Clock:", trovis.clock.datetime)
# Writes (reverse the scaling/encoding automatically)
await trovis.heating_circuit_1.set_room_setpoint_day(21.5)
await trovis.heating_circuit_1.set_mode(OperatingMode.DAY)
await trovis.hot_water.start_forced_charge()
finally:
await conn.close()
asyncio.run(main())
Updating just one sub-system
await trovis.hot_water.async_update() # only reads the HK4 registers
unsub = trovis.hot_water.add_update_listener(refresh_my_entity)
Command-line tool
script/query.py connects to a controller, reads it once, and prints every
value — handy for checking a real device without Home Assistant. It needs a
concrete backend, so install the cli extra (pip install trovis-modbus[cli],
or run via uv run --extra cli):
# Network gateway (RTU-over-TCP by default — how Trovis gateways work):
uv run --extra cli python script/query.py tcp 192.168.1.50 --unit 246
# Serial / USB (defaults to the Trovis 19200 8N1 line):
uv run --extra cli python script/query.py serial /dev/ttyUSB0 --unit 246
Use --port, --framer {rtu,socket} (TCP) or --baudrate/--parity/… (serial)
to override defaults; --help lists them all. Output is grouped by sub-system:
Device
------
model Trovis 5579
firmware_version 3.05
...
Heating circuit 1
-----------------
mode automatic
room_temperature 20.0 °C
room_setpoint_active 21.0 °C
flow_temperature 55.0 °C
pump_running True
...
Develop / test
uv sync
uv run pytest
The suite cross-checks every field against the canonical point list and
exercises decoding, the heating curve, writes and listeners against the
in-memory mock backend that ships with modbus-connection (its mock_modbus_unit
pytest fixture) — no real Modbus server or backend is needed.
Formatting/linting is ruff; install the commit hook with prek:
uvx prek install
uvx prek run --all-files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trovis_modbus-1.0.0.tar.gz.
File metadata
- Download URL: trovis_modbus-1.0.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48632e97a092e8cb1934a9d7df735abe423889c7d12715515bfa0cc1a1e9d75e
|
|
| MD5 |
67d8bd61d2d4813a7fa048a46821ae36
|
|
| BLAKE2b-256 |
29ead991a47f0c3a374179dd5c8459a880aa5c0c86e907ba1aad1deabb3d37e0
|
Provenance
The following attestation bundles were made for trovis_modbus-1.0.0.tar.gz:
Publisher:
publish.yml on Tom-Bom-badil/trovis-modbus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trovis_modbus-1.0.0.tar.gz -
Subject digest:
48632e97a092e8cb1934a9d7df735abe423889c7d12715515bfa0cc1a1e9d75e - Sigstore transparency entry: 1953963705
- Sigstore integration time:
-
Permalink:
Tom-Bom-badil/trovis-modbus@485d657a4f41baa7253bbc974e0e857b253a1a89 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Tom-Bom-badil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@485d657a4f41baa7253bbc974e0e857b253a1a89 -
Trigger Event:
release
-
Statement type:
File details
Details for the file trovis_modbus-1.0.0-py3-none-any.whl.
File metadata
- Download URL: trovis_modbus-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fba72b74519fe27767753dab7ff994e5c65d3d4ca12894f541683a315e608bd
|
|
| MD5 |
8a03e058ef9614d58907754dafa8062f
|
|
| BLAKE2b-256 |
514283d0bceb76d9a993cd0f2d944de402ca0b8ad756736b82c102a8313ed684
|
Provenance
The following attestation bundles were made for trovis_modbus-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on Tom-Bom-badil/trovis-modbus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trovis_modbus-1.0.0-py3-none-any.whl -
Subject digest:
6fba72b74519fe27767753dab7ff994e5c65d3d4ca12894f541683a315e608bd - Sigstore transparency entry: 1953963923
- Sigstore integration time:
-
Permalink:
Tom-Bom-badil/trovis-modbus@485d657a4f41baa7253bbc974e0e857b253a1a89 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Tom-Bom-badil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@485d657a4f41baa7253bbc974e0e857b253a1a89 -
Trigger Event:
release
-
Statement type: