-
Notifications
You must be signed in to change notification settings - Fork 2
Datapoints, reading, and writing
This page describes the declarative datapoint model, metadata, grouped polling, invalid-value handling, write access, operating modes, native date/time values, and selected derived values.
The library uses declarative datapoint definitions rather than scattering raw Modbus addresses throughout the code.
A catalog entry describes the technical and semantic properties of a holding register or coil.
Typical metadata includes:
- manufacturer reference such as
HR40145orCL137, - zero-based Modbus address,
- holding-register or coil type,
- signed or unsigned encoding,
- scale,
- unit,
- minimum and maximum,
- write step,
- enum type and options,
- invalid raw values,
- writable state,
- model applicability,
- read-grouping information.
Manufacturer-style references remain visible in source because they are easier to compare with TROVIS documentation. Conversion to zero-based Modbus addresses is centralized in the library.
The library is the authoritative source for controller-specific facts. A consuming application should not need to duplicate:
- whether a value is writable,
- which value range is valid,
- how the raw value is scaled,
- whether the raw value is signed,
- which enum values are valid,
- which controller models support the value,
- which write preconditions apply.
Applications may decide presentation details, but should not redefine controller behavior.
The catalog covers the direct datapoints required by the project reference and adds model-specific values where verified.
Parity is functional rather than entity-count based. For example, one native
date value can replace several raw words and display templates, and one enum
can replace a raw number plus application-specific formatting logic.
The library groups adjacent fields into bounded Modbus reads. The planning limit is deliberately conservative:
maximum span: approximately 50 registers or coils
This reduces protocol overhead without creating very large or fragile requests.
The planner respects:
- holding-register versus coil separation,
- known manufacturer block boundaries,
- catalog gaps,
- controller-model restrictions,
- active Rk1-Rk3 slot count,
- configured readable ranges.
A normal application refreshes the device with:
await device.async_update()The library then:
- builds the required read plan,
- performs grouped requests,
- decodes raw values,
- handles invalid-value sentinels,
- updates component properties,
- refreshes configuration-dependent and derived values.
The complete device update is coordinated through one component group so that subsystems can share efficient reads.
TROVIS controllers use special raw values for missing sensors or unavailable data. The library converts these sentinels centrally rather than exposing them as plausible temperatures, percentages, or numbers.
This is especially important for:
- optional physical sensors,
- configurable inputs,
- model-dependent registers,
- values that are valid only for selected functions or systems.
An unavailable value is represented as an unavailable Python value, normally
None, rather than as the manufacturer's sentinel.
TROVIS controllers require explicit write access before protected values can be changed.
A typical sequence is:
await device.async_enable_writing()
try:
await device.rk1.set_room_setpoint_day(21.5)
finally:
await device.async_disable_writing()The default write-access code is provided by the library and may be overridden by the application.
The top-level object also exposes:
is_enabled = await device.async_read_writing_enabled()The local device.writing_enabled property represents whether writing was
enabled through the current library object. It is not a substitute for a direct
controller read when another client may change the state.
Components support metadata-driven writes:
await component.async_write_datapoint(field, value)Before writing, the library can perform:
- writable-state checks,
- type conversion,
- enum conversion,
- range validation,
- step validation,
- signed and scaled encoding,
- TROVIS write-access refresh,
- field-specific preconditions,
- one or more ordered register or coil writes.
This keeps application code free from raw address calculations.
Not every readable datapoint should automatically become writable. A field is marked writable only when the controller documentation and implementation support a verified write path.
Special command registers that may trigger controller actions, firmware operations, resets, or restarts remain read-only until their command values, ordering, and consequences are fully understood.
Applications should still provide their own user-facing safety controls. The library validates controller rules; it does not decide who is authorized to change a building system.
A TROVIS control circuit is not a conventional on/off thermostat. Its behavior is split across:
- an operating-mode register,
- a control-level coil,
- room and flow setpoints,
- heating curves,
- setback behavior,
- pumps and valves,
- controller-wide states.
The shared operating-mode enum models:
| Raw value | Meaning |
|---|---|
0 |
Program |
1 |
Automatic |
2 |
Standby |
3 |
Manual |
4 |
Day |
5 |
Night |
A complete shared enum is used even when a specific physical selector exposes only a subset of these positions.
Automatic has special TROVIS semantics:
- it changes the corresponding control-level coil to autonomous operation,
- it does not overwrite the stored operating-mode register.
Other operating modes use the supervisory or control level before writing the mode register.
This behavior belongs in the library because it is a controller rule, not a presentation detail.
Control-level coils are also available as readable state so applications can show whether a circuit or domestic-hot-water function is operating autonomously or under supervisory control.
Raw DDMM and HHMM registers are converted to native Python types.
The controller time is exposed as:
datetime.timeThe controller has minute resolution.
The complete controller date is composed from:
- the DDMM register,
- the year register.
It is exposed as:
datetime.dateWhen writing a complete date, the library writes the year first and then the day/month value. This ordering avoids transient invalid combinations around month lengths and leap years.
Some controller dates are year-independent recurring dates. They are represented
by the library's MonthDay type instead of inventing an arbitrary year.
MonthDay(month=5, day=15)The application decides how to present a yearless recurring date in its user interface.
Domestic-hot-water disinfection start and stop values are native
datetime.time objects and are validated against the documented controller
range.
Some useful values do not correspond to one physical register. The library may derive them when the calculation is controller-specific and broadly useful.
device.system_activity combines heating and domestic-hot-water operation into
a single enum-like state:
| State | Meaning |
|---|---|
IDLE |
Neither heating nor domestic-hot-water charging is active |
HEATING |
At least one built-in Rk1-Rk3 pump is active |
DOMESTIC_HOT_WATER |
Domestic-hot-water charging is active |
HEATING_AND_DOMESTIC_HOT_WATER |
Both are active |
The value is None when none of the required pump states is available.
The library exposes calculated day and night temperature ranges based on the relevant setpoints, switching differential, and hold values.
These replace presentation templates while keeping the calculation close to the controller semantics.
A derived estimate should not duplicate a better direct register. For example, a direct active charging setpoint should be preferred over reconstructing the same information from a sensor value and configured elevation.
Controller-specific validation and write failures use library exceptions so an application can distinguish them from transport errors. Important categories include:
- write access disabled,
- write access rejected,
- unsupported or unimplemented writes,
- invalid values.
Transport and connection failures remain the responsibility of the selected
modbus-connection backend.
Disclaimer: Any information on this wiki is informal advice only. It is not supported nor endorsed by Samson, Sauter, YADOS, Pewo or any other equipment maker. There is no warranty expressed or implied: you take sole responsibility for everything you do with your heating controller.