Releases: eman/alpha-hwr
Releases · eman/alpha-hwr
Version 0.5.0
What's Changed
Fixed
- Missing
PROPORTIONAL_PRESSUREin_MODE_BYTE_MAP: Added mode value1→ byte0x01, preventing aKeyErrorwhen starting or stopping the pump in proportional pressure mode. - Alarm/warning descriptions not populated:
read_alarms()now resolves each active alarm and warning code againstERROR_CODES, populatingalarm_descriptionandwarning_descriptionas comma-separated human-readable strings. Unknown codes fall back to"Unknown (<code>)".
Changed
- CLI alarm panel: The alarm status panel now lists every active alarm and warning code with its description rather than showing only a single code.
Tests
- Extended
test_read_alarmsto assertalarm_descriptionandwarning_descriptionare correctly populated. - Added
test_read_alarms_unknown_code_fallbackto verify the"Unknown (<code>)"fallback for codes not present inERROR_CODES.
Full changelog: https://github.com/eman/alpha-hwr/blob/main/CHANGELOG.md
Version 0.4.0
[0.4.0] - 2026-02-14
Fixed
- Protocol documentation errors in
04_set_mode.md:- Corrected float encoding example:
0x46E5B000is 29400.0 Pa (3.0 m), not 14710.0 Pa (1.5 m). Updated to correct hex46 65 D7 E6. - Fixed Step 1 packet length byte:
0x14(20), was incorrectly0x12(18). - Fixed Step 2 packet length byte:
0x0C(12), was incorrectly0x10(16). - Fixed Step 2 OpSpec byte:
0x88, was incorrectly0x84. - Aligned DHW Cycle Time suffix to match code:
38 C6 76 EF(was38 C6 70 00).
- Corrected float encoding example:
set_clock()completely broken: Rewrote to use standard Class 10 SET viabuild_data_object_set(0x5E00, 0x6401, data)with Type 322 payload. The old implementation used a non-standard frame format missing ServiceID/Source bytes, which the pump silently rejected. Updated module docstring with correct TypeScript and Rust reference implementations.ControlService._current_modenot synced from pump:get_mode()now updates_current_modefrom the actual pump state, sostart()/stop()send the correct mode byte.- Missing
PROPORTIONAL_PRESSUREin_MODE_SUFFIX_MAP: Added mode0x01with suffix45 65 70 00, preventing silent command rejection when starting/stopping in proportional pressure mode. - Dead code in
ControlService._send_with_retry: Removed unreachablelogger.debug()afterreturn False. build_write_requestCRC scope: CRC now excludes the start byte (packet[1:]), consistent with all other frame builders.- OpSpec overflow in
build_data_object_set: Added guard that raisesValueErrorwhen payload exceeds 6-bit OpSpec maximum (63). Callers with large payloads must useoverride_op. - Test vector comment: Fixed "little-endian" to "big-endian" for ObjID
0x005Dinframe_parser.py. TelemetryObjecttuple order: Changed from(SubID, ObjID)to(ObjID, SubID)to match the decoder match pattern inTelemetryDecoder.decode()andFrameParser.is_telemetry_frame().- MockPump
_build_ack_responselength byte: Fixed LEN from0x06to0x04so the Transport's packet assembly logic doesn't hang waiting for 2 extra bytes that never arrive. Also fixed_build_error_responseand_build_class2_responselength calculations. - MockPump
_handle_set_clock: Updated to handle new Class 10 SET format (was using old non-standard format). - Test performance: 5-second BLE scan in every mock test: Patched
_scan_advertisement_datain all test fixtures to skip the realBleakScanner.discover(timeout=5.0)call. Integration tests dropped from 144s to 35s.
Deprecated
EventLogService.get_cycle_timestamps(): UseHistoryService.get_cycle_timestamps()instead. This method violated the service layer architecture by creating aHistoryServiceinternally.
Changed
- Style: Added
from __future__ import annotationstoutils.py,constants.py,models.py. ReplacedOptionalwith| Noneinutils.py.
Added
- Refactored Control Modes and Setpoints:
- Implementation of the 5 primary ALPHA HWR control modes using Class 10 (Object 0x0601) for improved reliability.
- Added support for AUTOADAPT toggle in Temperature Range Control (Mode 27).
- New CLI command
set-proportionalfor proportional pressure mode. - Enhanced CLI
set-modewith aliases and better help text.
- Full implementation of Mode 25 (DHW_ON_OFF_CONTROL / Cycle Time Control):
- Added support for reading and writing cycle time parameters (on/off minutes) to the library.
- Added CLI commands:
alpha-hwr control set-cycle-timeandalpha-hwr control get-cycle-time. - Added comprehensive integration tests using
MockPump. - Updated
MockPumpto simulate Mode 25 protocol behavior.
Changed
- Test Infrastructure and Dependencies:
- Refactored
pyproject.tomlto use a dedicatedtestoptional dependency group. - Updated GitHub Actions CI to install test extras and ensure all required plugins are present.
- Improved
tests/conftest.pyto explicitly loadpytest-benchmark, ensuring fixture availability during parallel execution. - Unified
_send_configuration_commitimplementation inBaseServicefor all service modules.
- Refactored
Fixed
- Start/Stop Commands: Fixed start and stop commands silently failing.
The control payload now uses the correct mode-specific suffix bytes
instead of encoding0.0(which the pump firmware rejected). The CLI
also reads the pump's current control mode before sending start/stop to
avoid accidentally switching modes. - Control Mode Setpoints: Fixed floating-point precision issues in integration tests by using
pytest.approx. - MockPump Reliability: Fixed missing logger definitions and improved OpSpec 0xB3 ID parsing.
- CI Test Failures: Resolved "fixture not found" errors by properly managing benchmark plugin loading.
Documentation
- Documentation site version now sourced from
pyproject.tomland auto-
deployed via GitHub Actions to keep https://eman.github.io/alpha-hwr up
to date.
[Unreleased] - 2026-02-01
Added
- BLE connection to Grundfos ALPHA HWR pumps
- Telemetry reading (Flow, Head, Power, Temperature, Voltage/Current, Speed)
- Passive monitoring mode with continuous data stream
- CLI interface for monitoring and control
- AsyncIO-based architecture using
bleak - Type-safe API with Pydantic models
- Cross-platform device addressing (macOS UUID / Linux+Windows MAC)
Service Enhancements
- Power-On Time History
- Added power-on time trend data to HistoryService (Object 53, SubID 454)
- Extended TrendDataCollection model with
power_on_time_seriesfield - Updated history CLI to display power-on time trends in hours
- Event Log Service - Complete Protocol Decoding
- Fully decoded EventLogMetadata structure (SubID 10199, 7 bytes)
- CLI commands:
alpha-hwr events list,alpha-hwr events show INDEX,alpha-hwr events metadata
- History Service - CLI Implementation
- New CLI commands for historical/trend data access
alpha-hwr history trends [--detailed]- Display flow/head/temperature trendsalpha-hwr history timestamps [--count 10|100]- Show cycle timestamps
- Schedule Management
- Read/write weekly schedules from all 5 layers (SubIDs 1000-1004)
- Enable/disable global schedule with
set_schedule_enabled() - CLI commands:
alpha-hwr schedule [--enable|--disable|--set-entry|--clear-day|--clear-layer] - Export/import schedules as JSON for backup/restore
- Configuration Backup and Restore
- Save/Restore pump configuration including schedules, modes, and setpoints to JSON
- CLI commands:
alpha-hwr config backupandalpha-hwr config restore
Changed
- Major Architectural Refactor
- Complete codebase restructure: Moved from a monolithic client to a modular service-oriented architecture.
- New
corelayer: Handles connection, authentication, session state, and transport independently. - New
protocollayer: Separated frame building, parsing, and codec logic. Added support for Class 3 and Class 10 GENI protocols. - New
serviceslayer: Logic split into dedicated services (Telemetry, Control, Schedule, etc.). - New
clientfacade:AlphaHWRClientdelegates to specialized services. - New
clistructure: CLI commands organized by domain using Typer.
- Control Service - Enhanced Safety and Reliability
- Migrated primary control modes (Constant Pressure, Speed, Flow, Proportional Pressure) from Class 3 to Class 10 (Object 0x0601) for better hardware compatibility.
- Added setpoint validation to all control mode setters
- Improved error messages for out-of-range setpoints
- Now uses
transport.query()for reliable request/response transactions
Fixed
- Profile Parser: Resolved MyPy type-checking errors and improved XML parsing robustness by adding null checks for the root element in
profile_parser.py. - Device Statistics Bug: Fixed statistics returning None after BaseService refactoring.
- Schedule Write Operations: Fixed to use correct OpSpec 0xB3 format discovered through protocol analysis.
- BLE Packet Splitting: Fixed packet splitting logic to handle 3+ chunks for large data writes.
v0.3.0
What's new
- Device MAC address configuration storage with typed schema and CLI support
- Bandit security scanning added to tox workflow
- mkdocstrings-generated API docs with strict warnings resolved; ESPHome integration docs refreshed with C++ reference and troubleshooting guidance
- CI workflows now cancel in-progress runs when superseded
Fixes
- Correct magic authentication packet bytes and BLE discovery alignment with the CLI implementation
- Motor State telemetry offsets and SETPOINT documentation clarified
- Type-checking fixes for configuration handling (BasedPyright/MyPy) plus ruff cleanups; hardened XML profile parsing when root elements are missing
v0.2.0 - First Public Release
🎉 First Public Release
Highlights
- Complete BLE communication library for Grundfos ALPHA HWR pumps
- Full type safety with mypy and basedpyright (0 errors)
- Comprehensive CLI tool for pump management
- 499 passing tests with 56% code coverage
- Complete documentation at https://eman.github.io/alpha-hwr/
Features
- Device Management: Connect, authenticate, and read device info
- Control Operations: Set control modes (constant pressure, proportional pressure, constant speed, flow control)
- Telemetry: Real-time monitoring of motor state, flow, pressure, temperature, and alarms
- Scheduling: Create and manage time-based operation schedules
- History: Read and export historical data (trend logs)
- Configuration: Backup and restore pump configurations
- Event Log: Read pump event logs and alarms
Technical Improvements
- Fixed all basedpyright type errors
- Improved test fixtures and mocking
- Updated serial number handling to match hardware behavior
- Removed unused imports and improved code quality
Requirements
- Python 3.13 or higher
- Bluetooth Low Energy support
Installation
pip install alpha-hwrQuick Start
# Discover pumps
alpha-hwr device scan
# Connect and read device info
alpha-hwr device info AA:BB:CC:DD:EE:FF
# Monitor telemetry
alpha-hwr monitor telemetry AA:BB:CC:DD:EE:FFSee the documentation for full usage examples.