grundfos-modbus
Read Grundfos pumps through a CIM 200 / CIM 500 Modbus module, as typed Python objects, on top of modbus-connection.
Supported devices
The register map is Grundfos' "Modbus for Grundfos pumps" functional profile (document 6012947), which covers MAGNA3 and MAGNA3-D circulators, E-pumps with MGE motors (TPE, NBE, NKE, CRE and so on) and CUE drives, fitted with a CIM 200 (Modbus RTU) or CIM 500 (Modbus TCP) module.
It has been run against one MAGNA3 40-80 F with a CIM 500 on Modbus TCP. Other pumps in the profile should work but are untested.
CIM 500 setup notes
- Set the module's rotary switch to 1 (Modbus TCP). It ships at 0 (PROFINET), where its IP fields are read-only. Changing the switch resets the module's network settings to the factory address.
- The module has two addresses: the web server (factory 192.168.1.100, login admin / Grundfos, which forces a new password) and a separate Modbus TCP address, set on the "Real Time Ethernet Protocol" page once the switch is at 1. Modbus is on port 502; the unit ID is ignored.
- The module is powered by the pump. If the pump's supply is switched (by a zone relay, say), the module is unreachable whenever the pump is off.
What it covers
| Component | Registers | What |
|---|---|---|
cim |
00021-00037 | Module version, GENIbus link counters, the product's unit family/type (decoded to a name such as "MAGNA3"), product software version and date |
status |
00201-00225 | Status bits (on, rotating, alarm, warning, at max speed...), process feedback, control and operating mode, alarm and warning codes, feedback sensor unit and range, frequency limits, setpoint range, flow-estimation state, PI gains, control source |
data |
00301-00362 | Head, flow, relative performance, speed, frequency, setpoints, motor current, DC-link voltage, power, temperatures, specific energy, operating/powered hours, energy, starts, differential and remote pressures, flow limit, the heat meter and pumped volume |
Each component is one block read, three requests per update. The module answers both function code 3 and 4 for these blocks; this library uses 3.
Decoding conventions:
- A register the pump doesn't supply reads 0xFFFF (0xFFFFFFFF for 32-bit
values) and decodes to
None. - Temperatures arrive in hundredths of a kelvin and decode to °C.
- Codes decode to
ControlMode,OperationMode,AlarmCode,ControlSource,FlowEstimationStateandFeedbackSensorUnit; a code the profile doesn't list stays a plainint. Status bits decode to thePumpStatusflag. data.has_heat_meteris true only when heat power is available. Without a second temperature sensor the heat energy counters read 0, not "not available".
Read-only
The profile has a control block (00101-00112: remote/local, on/off, control mode, setpoint, flow limit). This library doesn't write it. Taking a pump into remote control is a decision for whoever wires it up, not a default.
Installation
Not on PyPI yet. Install from GitHub:
pip install git+https://github.com/cwm12345/grundfos-modbus
For Home Assistant, you don't need this directly: use the ha-grundfos integration, which includes a copy.
Usage
import asyncio
from modbus_connection import ModbusTcpParams
from modbus_connection.tmodbus import ModbusConnection
from grundfos_modbus import GrundfosPump
async def main() -> None:
connection = ModbusConnection(ModbusTcpParams(host="192.168.1.50", port=502))
try:
pump = GrundfosPump(connection.for_unit(1))
await pump.async_update()
print(pump.cim.product, pump.status.control_mode)
print(
pump.data.volume_flow,
"m³/h at",
pump.data.head,
"bar,",
pump.data.power,
"W",
)
finally:
await connection.close()
asyncio.run(main())
Or from the command line: uv run script/query.py 192.168.1.50.
Development
uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check . && uv run mypy
The tests run against modbus-connection's in-memory mock backend, seeded with registers captured from a live MAGNA3. No hardware is needed.
License
Unlicense: public domain.
Metadata
Release files for grundfos-modbus 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grundfos_modbus-0.1.0.tar.gz | 44.4 kB | With provenance | Details for grundfos_modbus-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grundfos_modbus-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for grundfos_modbus-0.1.0-py3-none-any.whl |
Total release size: 58.0 kB
Release files / grundfos_modbus-0.1.0.tar.gz
| Download URL | grundfos_modbus-0.1.0.tar.gz |
|---|---|
| Size | 44.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7adb843b46197fa5aaf6b758b41fdf0b9d449883c9a38ccb81a4c72771c62144
|
|
BLAKE2b-256 checksum How to use checksums |
ac0450ede38277d50f2503489c60a71f1e7ff639e9903a989487752f480b8be5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Nov 16, 2026.
Transparency logRelease files / grundfos_modbus-0.1.0-py3-none-any.whl
| Download URL | grundfos_modbus-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
246cee0bb5a191faf519e5b59f76bddd0f06751bbb3d80b6423a5ba098a375f3
|
|
BLAKE2b-256 checksum How to use checksums |
50b31936621ee2aa9b2d8a0dfe80f7b8752f4f14225117af31c744ed82af724e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.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 Nov 16, 2026.
Transparency logSecurity for grundfos-modbus 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for grundfos_modbus-0.1.0.tar.gz
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 Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.