Skip to main content

grundfos-ble

CI PyPI Python License: MIT

Async, typed Python library for Grundfos circulator pumps that speak GENIbus over Bluetooth LE. The only supported pump today is the ALPHA2 GO. The framing layer is transport-agnostic and the pump profile is data, which should make related Grundfos Bluetooth pumps (ALPHA3, ALPHA HWR, SCALA1) easier to add, but none of them is supported yet.

This is a preliminary, read-only release. It reads a pump's state and values. Writing to a pump is not supported yet.

The library was written for use under Home Assistant, but it does not depend on it.

This project is not affiliated with, endorsed by or supported by Grundfos. Product names are used only to identify compatible pumps.

Safety. A circulator pump is part of a heating system. This release only reads, but later releases will be able to change how the pump runs, and wrong settings can stop circulation. The library is tested on one ALPHA2 GO and comes with no warranty (see the licence). Use it at your own risk.

What it does

  • Decodes the pump's advertisement (service UUID 0xFE5D), including the flag that says the Bluetooth button was just pressed.
  • Connects through bleak and bleak-retry-connector, pairs on every connection, and talks GENIbus over the single GENI characteristic. Only ESPHome Bluetooth proxies have been tested. On a local BlueZ adapter it registers the pairing agent BlueZ needs when a new bond is expected (BleTransport(..., pairing=True)); that path is untested on hardware here. WinRT pairing failures are not recognised as PairingRequired and surface as GrundfosConnectionError.
  • Matches each reply to its request by shape, as GENIbus replies carry no request id, and closes the link whenever a request does not complete with a reply, so a late answer cannot be taken for the next request's.
  • Reads flow, head, power, voltage, current, speed, electronics temperature, control and operation mode, setpoint, factory limits, the panel setting, flow limiters, AutoNight, alarms, warnings and, where the pump has them, statistics, temperatures and energy. The stored panel presets have no typed reader. Fetch them with GrundfosPump.get_object and registry.alpha2go.panel_preset.
  • Does not support writes yet. The write methods (control mode, setpoint, limiters, AutoNight, start/stop, alarm reset) raise NotSupported. See Known limitations below.

Install

pip install grundfos-ble

Python 3.13 or newer; depends on bleak>=3.0.2 and bleak-retry-connector>=4.7.1 (and dbus-fast>=4 on Linux).

Usage

import asyncio

from bleak import BleakScanner

from grundfos_ble import BleTransport, GrundfosPump, PairingRequired


async def main() -> None:
    device = await BleakScanner.find_device_by_address("AA:BB:CC:DD:EE:FF")
    if device is None:
        raise SystemExit("Pump not found")

    transport = BleTransport(device, name="My pump")
    pump = GrundfosPump(transport)

    try:
        await transport.connect()  # pairs (encrypts) every time
    except PairingRequired:
        print("Press the pump's Bluetooth button and connect again within 3 seconds")
        raise

    try:
        identity = await pump.read_identity()
        values = await pump.read_measurements()
        print(identity.model, values.flow_m3h, "m³/h", values.head_m, "m", values.power_w, "W")
    finally:
        await transport.disconnect()


asyncio.run(main())

BleTransport is also an async context manager: async with BleTransport(device) as transport: connects on entry and disconnects on exit.

The library never scans; you hand it a BLEDevice. Under Home Assistant that device comes from the Bluetooth integration and HA chooses the proxy.

Command line

grundfos-ble talks to a pump through this computer's own Bluetooth adapter (an ESPHome proxy is only reachable from Home Assistant). Every command is read-only: none writes to the pump, and none sends arbitrary bytes.

$ grundfos-ble scan                      # pumps nearby, with their advertisement flags
$ grundfos-ble scan --watch --seconds 300 # every change of a pump's advertisement
$ grundfos-ble pair AA:BB:CC:DD:EE:FF    # waits for the Bluetooth button, then pairs
$ grundfos-ble read AA:BB:CC:DD:EE:FF --json
$ grundfos-ble probe AA:BB:CC:DD:EE:FF   # which optional objects answer, and their versions
$ grundfos-ble get AA:BB:CC:DD:EE:FF 88/25
$ grundfos-ble watch AA:BB:CC:DD:EE:FF --interval 60 --verbose-timings
$ grundfos-ble capture AA:BB:CC:DD:EE:FF session.hex --note "display: 1.0 m3/h"

pair makes a new bond on the pump. The pump has held at least two at once, but its maximum is not documented and it offers no way to forget one, so pair only computers you will keep using. info and capture leave out the serial number and production code unless you pass --include-serial, so their output can be shared; capture writes the fixture format grundfos_ble.testing reads. Add -v before the command to log every frame.

On macOS the address is a CoreBluetooth UUID, not a MAC: take it from scan. The terminal needs Bluetooth permission (System Settings → Privacy & Security → Bluetooth), and during pair macOS asks in a dialog whether to connect to the pump; accept it within the button window. The pump takes one connection at a time, so close the GO app and pause Home Assistant's polling (disable the integration entry) while you use the command line.

Pairing, in one paragraph

The pump drops any link that is not encrypted within about two seconds, and accepts pairing only for about three seconds after its Bluetooth button is pressed. Once paired, the bond lives on the adapter or proxy that paired. When tested, the pump held at least two bonds at once, a phone and an ESPHome proxy. Every connection must still call pair(); with a bond that is a quick re-encrypt. PairingRequired is raised when the pump refuses pairing (ESP-IDF reason 82, seen through ESPHome proxies, or BlueZ AuthenticationFailed). A link that connects but never answers shows up as reply_seen staying false; outside pairing that points at the radio, not the bond, so do not treat it as a reason to re-pair. A pump losing a bond has never been observed, so how that looks is unknown. A local BlueZ adapter would keep reconnecting with the dropped bond and never pair again, so call remove_bluez_bond(device) before re-pairing through one, once the button has been pressed. An ESPHome proxy whose firmware cannot pair raises PairingUnsupported; the pump answers only an encrypted link, so that proxy needs a newer ESPHome. BleTransport.last_source names the adapter or proxy the latest attempt went through, so a refusal can be pinned on the path that saw it.

Protocol

GENIbus telegram SD LEN DA SA APDU… CRC16 (CRC-16/CCITT, init 0xFFFF, inverted), requests 27 … E7 F8, replies 24 … F8 E7, frames written in 20-byte pieces. Most values live in class-10 "data objects" addressed by (id, sub-id) whose replies carry a status type version size header and big-endian floats. See docs/protocol.md for the full inventory with the provenance of every item.

Known limitations

Writing to a pump is not supported yet. The write methods raise NotSupported, and this project has never sent a write to a pump. The encoders behind them are tested against frames captured from the Grundfos GO app, and that is all. When a release does support writes, a pump will write only if it was created with GrundfosPump(transport, allow_writes=True), so upgrading never starts writes on its own. That guard is in GrundfosPump only: BleTransport.request() and the GENIbus encoders send whatever they are given. Before writes can be enabled, at least these need fixing:

  • set_flow_limiter does not check the limit against the pump's range, so it accepts 0, negative, NaN and huge values. A near-zero maximum flow could starve a circuit of circulation.
  • set_setpoint skips its range check when the factory limits are not available.
  • Access and MODES_SEEN_ON_ALPHA2_GO are not enforced, so objects whose meaning is unknown could be written.
  • set_setpoint writes the control mode first. If the second write fails, the mode has changed and the error does not say so. The read-back is returned but not compared, and the pump clamps silently.
  • Read-modify-write rebuilds objects instead of patching the raw bytes, and does not refuse a different object version or size.
  • Cancelling mid-write can leave part of a SET at the pump.

Reads have limitations too:

  • The object version is not checked, so a firmware that changes a layout under the same type would decode into wrong values.
  • The advertisement parser checks only the length, not the 03 01 00 prefix.

Development

nix develop          # or: uv sync --group dev && source .venv/bin/activate
ruff check . && ruff format --check .
mypy
pytest --cov

Measurements, operation state, statistics and the other optional objects are tested against frames recorded from a real ALPHA2 GO (src/grundfos_ble/testdata/, available to dependants as grundfos_ble.testing.FIXTURES). Identity and string reads are tested only on hand-built or ALPHA HWR frames, and the Bluetooth connection (establish_connection) is always mocked. Add new captures in the same format (> request, < notification pieces) rather than hand-built frames.

Status

Alpha, read-only. Process and motor values were checked against the panel of one ALPHA2 GO. That pump also answered the operation state, panel setting, flow limiters, AutoNight, alarms, warnings, statistics, temperatures and energy with plausible values, with no fault active. The remaining objects come from captured traffic or documentation for related pumps. Other pump families are unverified.

Acknowledgements

This library was written from the GENIbus specification and from frames captured on real pumps. The Bluetooth link, including the BlueZ pairing agent adapted from alpha-hwr, lives in ble-bond, which ships alpha-hwr's MIT notice. No code from these projects is used here, but their published protocol research made the work possible:

Licence

MIT, see LICENSE.

Metadata

Release files for grundfos-ble 0.4.0

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

Source distribution (sdist)

Source distribution for grundfos-ble 0.4.0
File Size Uploaded Provenance Actions
grundfos_ble-0.4.0.tar.gz 77.5 kB With provenance Details for grundfos_ble-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for grundfos-ble 0.4.0
File Interpreter ABI Platform Actions
grundfos_ble-0.4.0-py3-none-any.whl Python 3 none any Details for grundfos_ble-0.4.0-py3-none-any.whl

Total release size: 134.6 kB

Release files / grundfos_ble-0.4.0.tar.gz

Download URL grundfos_ble-0.4.0.tar.gz
Size 77.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb1f9288a7a091e4d97722ad9c4ba6112b16ba0c4b721291df8efb152cb4c204
BLAKE2b-256 checksum
How to use checksums
2ff5a30f22e4cc324dd3f00841b2b3c08045830c87622f021af86b2385537e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 log

Release files / grundfos_ble-0.4.0-py3-none-any.whl

Download URL grundfos_ble-0.4.0-py3-none-any.whl
Size 57.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
def8e788ee0630b6e6d1c2527fcaf0e401b174c63e4819ea86eda281afd52dd8
BLAKE2b-256 checksum
How to use checksums
0b2904572f3571375422fe4b47b54a07638507dbd0ea2b902f61ae137785099a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 log

Security for grundfos-ble 0.4.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.

Select from 2 files

Attestation for grundfos_ble-0.4.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 log

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

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