Skip to main content

WAB11 Python Library

A Python library for controlling Weishaupt WAB11 heat pump controllers via Modbus TCP.

Features

  • Digital Twin Pattern: Maintains a synchronized local representation of the heat pump state
  • Type-Safe Models: Pydantic-based models for all WAB11 components
  • Secure by Default: Validated writes, rate limiting, and confirmation for critical operations
  • Async & Sync Support: Both asyncio-based and synchronous interfaces
  • Event System: Subscribe to state changes with callbacks
  • Comprehensive Audit Log: Full trail of all operations

Installation

pip install wab11

Or install from source:

git clone https://github.com/your-repo/wab11.git
cd wab11
pip install -e .

Requirements

  • Python 3.10+
  • pymodbus >= 3.5
  • pydantic >= 2.0

Quick Start

Async Usage

import asyncio
from wab11 import WAB11Client, SystemMode

async def main():
    async with WAB11Client("192.168.1.100") as wab:
        # Sync state from device
        await wab.sync()

        # Read values
        print(f"Outdoor temperature: {wab.system.outdoor_temp}°C")
        print(f"System mode: {wab.system.system_mode.name}")
        print(f"Operating state: {wab.system.operating_state.name}")

        # Check for errors
        if wab.system.has_error:
            print(f"⚠️ Error code: {wab.system.error_code}")

        # Heating circuit info
        for i, hk in enumerate(wab.heating_circuits, 1):
            if hk.is_configured:
                print(f"HK{i}: {hk.room_temp.celsius}°C → {hk.room_setpoint_effective.celsius}°C")

        # Hot water
        print(f"Hot water: {wab.hot_water.temperature.celsius}°C")

asyncio.run(main())

Sync Usage

from wab11 import WAB11SyncClient, SystemMode

with WAB11SyncClient("192.168.1.100") as wab:
    wab.sync()
    print(f"Outdoor: {wab.system.outdoor_temp}°C")
    print(f"Mode: {wab.system.system_mode.name}")

Setting Values

async with WAB11Client("192.168.1.100") as wab:
    # Change system mode (requires confirmation for safety)
    await wab.set_system_mode(SystemMode.HEATING, confirmed=True)

    # Set heating circuit setpoint
    await wab.set_heating_circuit_setpoint(
        circuit=1,
        level="comfort",  # "comfort", "normal", or "setback"
        temperature=22.0
    )

    # Activate party mode for 3 hours
    await wab.set_heating_party_pause(circuit=1, mode="party", hours=3.0)

    # Hot water boost
    await wab.trigger_hot_water_push(minutes=30)

Continuous Monitoring

async with WAB11Client("192.168.1.100") as wab:
    # Subscribe to changes
    def on_change(event):
        print(f"{event.register}: {event.old_value}{event.new_value}")

    wab.on_change(on_change)

    # Start background polling
    await wab.start_polling(interval=5.0)

    # Keep running
    await asyncio.sleep(3600)

Security

The library implements several security measures:

Write Validation

All writes are validated against documented limits:

# This will raise ValidationError
await wab.set_heating_circuit_setpoint(1, "comfort", 50.0)  # Too high!

Critical Operation Confirmation

Safety-critical operations require explicit confirmation:

# This raises SafetyError
await wab.set_system_mode(SystemMode.STANDBY)

# This works
await wab.set_system_mode(SystemMode.STANDBY, confirmed=True)

Rate Limiting

Write operations are rate-limited to protect the controller:

  • Max 10 writes per minute globally
  • Max 2 writes per register per minute
  • 1 second cooldown between same-register writes

Audit Logging

All operations are logged:

# Get recent write operations
for entry in wab.audit_log.get_writes():
    print(f"{entry.timestamp}: {entry.register} = {entry.new_value}")

Network Security Warning

⚠️ Important: The Modbus TCP interface is unencrypted. As per Weishaupt documentation, the controller should only be accessible on an isolated network segment, not your general home LAN.

API Reference

WAB11Client

The main async client class.

Properties:

  • system - Global system state
  • heating_circuits - List of 5 heating circuits (HK1-HK5)
  • hot_water - Hot water state
  • heat_pump - Heat pump state
  • secondary_heat - Secondary heat source state
  • inputs - Digital inputs and SG-Ready state
  • energy - Energy statistics
  • is_connected - Connection status
  • last_sync - Timestamp of last sync

Methods:

  • connect() / disconnect() - Connection management
  • sync() - Synchronize state with device
  • start_polling(interval) / stop_polling() - Background polling
  • on_change(callback) - Subscribe to state changes
  • set_system_mode(mode, confirmed) - Set system mode
  • set_heating_circuit_mode(circuit, mode) - Set HK mode
  • set_heating_circuit_setpoint(circuit, level, temp) - Set temperature
  • set_heating_party_pause(circuit, mode, hours) - Party/pause mode
  • set_hot_water_setpoint(level, temp) - Set hot water temp
  • trigger_hot_water_push(minutes) - Hot water boost
  • read_register(name) / write_register(name, value) - Raw access

Enums

from wab11 import (
    SystemMode,           # AUTOMATIC, HEATING, COOLING, SUMMER, STANDBY, SECOND_HEAT
    OperatingState,       # Current state (HEATING, COOLING, HOT_WATER, DEFROST, etc.)
    HeatingCircuitMode,   # AUTOMATIC, COMFORT, NORMAL, SETBACK, STANDBY
    SGReadyState,         # NORMAL, EVU_LOCK, RECOMMENDED, MAXIMUM
)

Exceptions

from wab11 import (
    WAB11Error,           # Base exception
    ConnectionError,      # Connection failures
    ValidationError,      # Invalid values
    SafetyError,          # Unconfirmed critical operation
    RateLimitError,       # Rate limit exceeded
)

Supported Registers

The library supports all documented WAB11 Modbus registers:

Range Description
30xxx System status (outdoor temp, errors, state)
31xxx Heating circuit status (HK1-HK5)
32xxx Hot water status
33xxx Heat pump status
34xxx Secondary heat source status
35xxx Digital inputs, SG-Ready
36xxx Energy statistics
40xxx System parameters
41xxx Heating circuit parameters
42xxx Hot water parameters
43xxx Heat pump parameters
44xxx Secondary heat source parameters
45xxx Input configuration

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run the default test suite
pytest

# Type checking
mypy src/wab11

# Linting
ruff check src/wab11

Testing

The default test suite uses a fake Modbus system defined in tests/fixtures/fake_system.json. That fixture is used for normal regression tests and is safe to run on any machine because it does not talk to a real controller.

The repository also includes a warm live-device test in tests/test_warm_live_device.py. This test is skipped by default and must be enabled explicitly. It is designed to be read-only:

  • It only connects, syncs state, syncs energy values, and reads registers
  • It does not call any library write API
  • It replaces the connection write method with a failing guard, so the test aborts immediately if any write is attempted

Run the warm test only when you intentionally want to exercise a real WAB11 device:

pytest tests/test_warm_live_device.py \
  --run-warm \
  --warm-host <ip-or-host>

Heating circuits are auto-detected when the option is omitted. Pass --warm-heating-circuits <1-5> only to override detection manually.

You can also provide the live-device settings through environment variables:

  • WAB11_TEST_HOST
  • WAB11_TEST_PORT
  • WAB11_TEST_UNIT_ID
  • WAB11_TEST_TIMEOUT
  • WAB11_TEST_HEATING_CIRCUITS

License

MIT License - see LICENSE file.

Disclaimer

This is an unofficial library. Use at your own risk. Always verify operations with the official Weishaupt documentation and ensure you understand the effects of any changes you make to your heating system.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wab11-0.2.0.tar.gz (139.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wab11-0.2.0-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file wab11-0.2.0.tar.gz.

File metadata

  • Download URL: wab11-0.2.0.tar.gz
  • Upload date:
  • Size: 139.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wab11-0.2.0.tar.gz
Algorithm Hash digest
SHA256 377dbc98f24d30077071adb69be71d0ca2ff120aadcb9ae35efcbed4f32042e8
MD5 7152cad19c5fd0bf41b6b051561c4ecf
BLAKE2b-256 891d53d74861498da0779e7fc4c81f2a5669e1fdc41462499f8da5345c4868c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for wab11-0.2.0.tar.gz:

Publisher: version_publish_main.yml on JulianKimmig/wab11

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wab11-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: wab11-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wab11-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26e6de91f9c94359e386cac53a0f4c7c66251a1bef922dce79da3871fcde45ea
MD5 4c18a1b74054b9a82263db7d26c968d8
BLAKE2b-256 b2afa1274f5fcfe2cd9507b73ecd2743fcae41229b2a270a9386a178a515840e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wab11-0.2.0-py3-none-any.whl:

Publisher: version_publish_main.yml on JulianKimmig/wab11

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 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