How elradix/daikin_cycle_ml works
Daikin Cycle ML is a local Home Assistant integration for monitoring Daikin Altherma heat-pump cycling. A configured heat-pump entity supplies telemetry; the coordinator polls it, detects and scores cycles, and evaluates them with per-mode learning and anomaly analysis. Advice and alerts surface through Home Assistant entities and notifications. SQLite preserves cycle and model history, while scheduled jobs maintain retention and retrain clusters. Edges reflect the README and sampled coordinator/service excerpts; unsampled subsystem wiring is included only where documented, and otherwise left out.
Main entry points: coordinator.py Polling coordinator · store.py Cycle store · services.py User services · db.py SQLite history
Components 22
Setup and polling
- Integration setup
config_flow.py - Integration lifecycle
__init__.py - Polling coordinator
coordinator.py
Cycle analysis
- Attribute reader
engine/attribute_reader.py - Cycle detector
engine/cycle_detector.py - Quality scorer
engine/quality_scorer.py - Actionable advice
engine/action_engine.py
Self-learning
- Feature extraction
ml/features.py - Adaptive thresholds
ml/adaptive_thresholds.py - Per-mode baseline
ml/baseline.py - Anomaly evaluation
engine/anomaly_engine.py - Cycle clustering
ml/clustering.py
State and services
- Cycle store
storage/store.py - SQLite history
storage/db.py - User services
services.py
Home Assistant output
- Alert generation
engine/notification_engine.py - Sensors and binaries
sensor.py - Binary sensors
binary_sensor.py - Diagnostics
diagnostics.py
Other components
- Home Assistant user
- Heat-pump entities
- HA notifications
Connections 26
- Home Assistant user → Integration setup: configures
- Integration setup → Integration lifecycle: provides setup
- Integration lifecycle → Polling coordinator: starts polling
- Heat-pump entities → Polling coordinator: provides state
- Polling coordinator → Attribute reader: reads attributes
- Polling coordinator → Cycle detector: detects cycles
- Polling coordinator → Quality scorer: scores cycles
- Polling coordinator → Feature extraction: extracts features
- Polling coordinator → Adaptive thresholds: observes cycles
- Polling coordinator → Per-mode baseline: updates baseline
- Polling coordinator → Anomaly evaluation: evaluates vector
- Polling coordinator → Actionable advice: generates advice
- Polling coordinator → Cycle clustering: reclusters history
- Polling coordinator → Alert generation: evaluates alerts
- Polling coordinator → Cycle store: updates records
- Polling coordinator → SQLite history: persists state
- Sensors and binaries → Polling coordinator: reads snapshot
- Sensors and binaries → Cycle store: reads cycles
- Binary sensors → Polling coordinator: reads status
- Binary sensors → Cycle store: reads cycles
- Polling coordinator → HA notifications: creates alerts
- User services → Polling coordinator: resolves entry
- User services → Cycle store: exports cycles
- User services → SQLite history: reads and writes
- Diagnostics → Polling coordinator: reads diagnostics
- Diagnostics → SQLite history: reads history