Complete, professional Home Assistant custom component for Hargassner pellet boilers with telnet interface. Built from scratch using modern best practices.
Version: 0.3.1 Status: Production Ready License: MIT
✅ Real-time Monitoring - Continuous telnet data stream ✅ Auto-Reconnect - Exponential backoff, never gives up ✅ Thread-Safe - Async/await architecture ✅ Robust Encoding - UTF-8, Latin-1, CP1252 support ✅ GUI Configuration - Config Flow with validation ✅ Multi-Firmware - Supports multiple boiler versions ✅ Energy Dashboard - Built-in energy sensor (kWh) ✅ Bilingual - English and German translations ✅ Error Tolerant - Graceful degradation, extensive error handling ✅ Professional Docs - Architecture, development, contributing guides
./
├── custom_components/bauergroup_hargassnerintegration/ # Main integration
│ ├── __init__.py # Entry point, setup/teardown
│ ├── config_flow.py # GUI configuration
│ ├── const.py # Constants
│ ├── coordinator.py # Data coordinator
│ ├── manifest.json # HA integration metadata
│ ├── sensor.py # Sensor platform
│ ├── src/ # Core business logic
│ │ ├── __init__.py
│ │ ├── firmware_templates.py # XML templates for firmware versions
│ │ ├── message_parser.py # Telnet message parser
│ │ └── telnet_client.py # Thread-safe telnet client
│ └── translations/ # Localization
│ ├── en.json
│ └── de.json
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # Technical architecture (in-depth)
│ ├── CONTRIBUTING.md # Contribution guidelines
│ ├── DEVELOPMENT.md # Developer setup & workflow
│ └── INSTALLATION.md # End-user installation guide
├── tests/ # Unit tests (starter)
│ └── test_message_parser.py
├── .gitignore # Git ignore patterns
├── LICENSE # MIT License
├── PROJECT_SUMMARY.md # This file
└── README.md # Main project README
Total: 18 files
Responsibilities:
- Persistent telnet connection (port 23)
- Background asyncio task for continuous receiving
- Automatic reconnection with exponential backoff (5s → 300s)
- Multi-encoding support (UTF-8, Latin-1, CP1252)
- Thread-safe data storage with
asyncio.Lock - Statistics tracking (messages, errors, reconnections)
Key Methods:
async_start()- Start client and background receiverasync_stop()- Graceful shutdownget_latest_data()- Thread-safe data access_receiver_loop()- Background message receiver_process_data()- Encoding detection and parsing
Responsibilities:
- Parse XML firmware templates
- Extract values from telnet messages
- Type conversion (float, int, bool)
- Digital parameter bit extraction
Key Classes:
HargassnerMessageParser- Main parserParameterDefinition- Individual parameter metadata
Supported Message Format:
pm <val0> <val1> <val2> ... <valN>
^^^^^ Space-separated values
Responsibilities:
- Bridge between telnet client and Home Assistant
- Periodic data refresh (5 seconds)
- Extends
DataUpdateCoordinatorfor HA integration - Error handling and recovery
Sensor Types:
- Connection Sensor - Connection status + statistics
- State Sensor - Boiler operating state (enum)
- Error Sensor - Error messages (enum)
- Parameter Sensors - Individual measurements
- Energy Sensor - kWh calculation from pellet consumption
Sensor Sets:
- STANDARD - 27 sensors (4 automatic + 23 parameters)
- FULL - All sensors from firmware template (varies by version)
Features:
- GUI-based setup (Config Flow)
- Connection validation before entry creation
- Options flow for runtime changes
- Unique ID validation (one entry per IP)
Boiler (Telnet Port 23)
↓ "pm 7 10.1 9.0 67.4 ..."
TelnetClient._receiver_loop()
↓ Decode (UTF-8/Latin-1/CP1252)
↓ Extract lines, find latest "pm" message
MessageParser.parse_message()
↓ Split values, map to parameters
↓ Type conversion, bit extraction
TelnetClient._latest_data (async locked)
↓ Poll every 5 seconds
Coordinator._async_update_data()
↓ Update event
Sensor Entities (Connection, State, Parameters, Energy)
↓ Display in Home Assistant UI
Currently supported firmware versions:
- V14_1HAR_q1 - 112 analog + many digital parameters
Adding new versions: Just add XML template to firmware_templates.py
pm 7 10.1 9.0 67.4 70 64.5 65 11 91.3 26 27.0 62.3 59.3 58.7 89 5 64 3 70 62 30 28.9 30 100 30.0 30.0 29 96.0 100 3 0 0 18 2 10 0 0 333 324 160 24 1 21 0 91 8.00 12.99 616 8.9 24209 140.0 110.3 28 -20.0 -20.0 0.0 60.0 -20.0 93.4 1 0 -20.0 0 20.0 20.0 0 1 0 120.0 0 20.0 20.0 0 1 0 120.0 0 20.0 20.0 0 1 0 -20.0 0 20.0 20.0 0 1 0 -20.0 0 120.0 0 -20.0 0 0.0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 E 21 0 0 2007 0 0 0
This message contains 138 values corresponding to:
values[0]= ZK (Boiler state) = 7values[3]= TK (Boiler temp) = 67.4°Cvalues[8]= TRG (Smoke gas temp) = 91.3°Cvalues[14]= Leistung (Output) = 89%values[20]= Taus (Outside temp) = 30°C- ... and so on
- Initial failure: Raises
ConfigEntryNotReady, HA retries - Runtime loss: Background task continues reconnecting
- Exponential backoff: 5s → 10s → 20s → ... → 300s max
- Invalid encoding: Try UTF-8 → Latin-1 → CP1252 → fallback
- Length mismatch: Log warning, parse available data
- Invalid values: Return
None, sensor shows "unknown"
- No data yet: Return empty dict (not an error on startup)
- Coordinator timeout: Automatic retry with backoff
- Update interval: 5 seconds (configurable)
- Memory usage: ~5-10 MB (typical)
- CPU usage: Minimal (async I/O)
- Network: ~1-2 KB/message, ~400 bytes/s average
- Add custom repository
- Install integration
- Restart HA
- Add via UI
- Copy
custom_components/hargassner_pelletto HA config - Restart HA
- Add integration via Settings → Devices & Services
# Via GUI (recommended), or YAML:
hargassner_pellet:
host: 192.168.1.100
firmware: V14_1HAR_q1
device_name: Hargassner Boiler
language: EN
sensor_set: STANDARD
pellet_energy_kwh_per_kg: 4.8 # Pellet energy content (3.0-6.0)
efficiency_percent: 90 # Boiler efficiency (50-100)Automatic Sensors (4):
- Connection Status
- Boiler State (Off/Ignition/Full Firing/etc.)
- Operation Status (OK/Errors)
- Heat Output (kWh) - Calculated from pellet consumption
Boiler & Combustion (8):
- Boiler Temperature (TK)
- Boiler Setpoint (TKsoll)
- Flue Gas Temperature (TRG)
- Burner Temperature (BRT)
- Output Power (Leistung)
- Efficiency (Effizienz)
- O2 Level (O2)
- Draft Actual (SZist)
Buffer & Storage (6):
- Buffer Top/Middle/Bottom (TPo, TPm, TPu)
- Buffer Fill Level (Puff Füllgrad)
- Buffer Setpoint Top/Bottom (Puffer_soll oben/unten)
Heating Circuits (3):
- Flow Temperature HC1 (TVL_1)
- Flow Setpoint HC1 (TVLs_1)
- Return Temperature (TRL)
Hot Water (2):
- Hot Water Temperature (TB1)
- Hot Water Setpoint (TBs_1)
Outside & Pellets (3):
- Outside Temperature (Taus)
- Pellet Stock (Lagerstand)
- Pellet Consumption (Verbrauchszähler)
Energy sensor automatically created:
- Name: "Wärmemenge" (DE) / "Heat Output" (EN)
- Formula:
Pellet Consumption (kg) × Energy Content (kWh/kg) × Efficiency (%) - Configurable Parameters:
- Pellet Energy Content: 3.0-6.0 kWh/kg (Default: 4.8)
- Boiler Efficiency: 50-100% (Default: 90%)
- Example: 100 kg × 4.8 kWh/kg × 0.90 = 432 kWh
- Compatible with HA Energy Dashboard
- Tracks total heat output from pellet heating
- Sensor attributes show current calculation parameters
- Telnet is unencrypted and unauthenticated
- Use only on trusted local networks
- Consider VPN for remote access
- Firewall appropriately
| Feature | Status |
|---|---|
| Telnet Client | ✅ Complete |
| Message Parser | ✅ Complete |
| Config Flow | ✅ Complete |
| Coordinator | ✅ Complete |
| Sensors | ✅ Complete |
| Translations (EN/DE) | ✅ Complete |
| Documentation | ✅ Complete |
| Unit Tests | |
| HACS Integration | ⏳ Pending |
| HA Core Integration | ⏳ Future |
- Write support (send commands to boiler)
- Additional sensor platforms (binary_sensor, switch)
- Historical data tracking
- Efficiency calculations
- Predictive maintenance alerts
- Custom Lovelace cards
- Comprehensive unit tests
- Integration tests
- ✅ Type hints throughout
- ✅ Docstrings for all public functions
- ✅ Error handling at all layers
- ✅ Async/await (no blocking I/O)
- ✅ Thread-safe data access
- ✅ PEP 8 compliant
- ✅ Home Assistant conventions followed
- README.md - User-facing overview
- INSTALLATION.md - Step-by-step setup guide
- ARCHITECTURE.md - Technical deep-dive (20+ pages)
- DEVELOPMENT.md - Developer workflow
- CONTRIBUTING.md - Contribution guidelines
- PROJECT_SUMMARY.md - This file
MIT License - See LICENSE file
- Issues: Report bugs and request features
- Discussions: Ask questions, share ideas
- Pull Requests: Contribute code (see CONTRIBUTING.md)
- Documentation: Help improve docs
- GitHub: https://github.com/bauer-group/IP-HargassnerIntegration
- Issues: https://github.com/bauer-group/IP-HargassnerIntegration/issues
Built with ❤️ for the Home Assistant community
Last Updated: 2025-11-22