My personal Home Assistant configuration for a house in Linz, Austria.
The setup uses a modular packages pattern — each feature lives in its own YAML file under packages/, keeping concerns separated and testable. A CI pipeline runs on every push to validate the configuration, lint YAML, and execute integration tests against a live HA instance.
Fully automated control of a Somfy-driven bioclimatic pergola roof (two synchronized covers).
- State machine: transitions through
frost,rain,rain_stopped,user_override, and multiple sun-tracking states - Sun tracking: calculates optimal slat angle from solar azimuth/elevation geometry; separate angles for heating vs. cooling season
- Rain recovery: timed drain sequence (8° → 15° progressive opening) before resuming normal operation
- Inputs: on/off toggle, heating/cooling mode selector, PV conversion factor, geometric parameters (east/west orientation offsets)
- Template sensors: effective sun angle, computed slat angle, tilt position, MaxOpenEast/West bounds, lower position limits
Automation for a ComfoConnect ERV (energy-recovery ventilator) via the comfoconnect custom component.
- Free cooling: detects when outdoor air is dry and cool enough to bypass heat recovery and flush the house
- Humidity flushing: boost mode triggered by high indoor humidity, schedule-gated (workday vs. weekend)
- Profile selection:
warm(moisture retention) →comfort→cool(bypass fully open), driven by dew-point thresholds - Sensors: derived dew point, filter status, boost countdown
A simple template sensor that classifies the current season based on a 48-hour mean of outdoor temperature.
- States:
active_heating→neutral→passive_cooling→active_cooling - Hysteresis thresholds prevent oscillation at boundaries
- Used by other packages (pergola, airflow) to select appropriate behaviour profiles
MQTT-based monitoring of a Victron solar/battery/grid installation (MPPT charger + AC-coupled PV inverter + MultiPlus 3-phase).
- Sensors: battery SOC, voltage and current; per-phase grid power (L1/L2/L3); PV generation; system losses
- Energy accumulation: trigger-based kWh integration sensors for solar, grid import/export, and load
- Utility meters: monthly billing meters aligned to the Austrian tariff reset date (1st of month)
- Status: charger/inverter mode detection, system state
MQTT sensors for every individually metered appliance, plus the wallbox abstraction layer.
- Shelly Plus Plug S: pool pump and rainwater pump — power, energy, voltage, current, relay state
- Shelly Pro 3EM: heating circuit — total active power and cumulative consumption
- Loxone appliances: washer, tumble dryer, dishwasher — no
expire_after, because Loxone publishes only on change and would otherwise go unavailable while idle - Wallbox:
sensor.wallbox_power/sensor.wallbox_energy— deliberately source-independent template wrappers
Wallbox indirection rule. The Energy Dashboard references sensor.wallbox_* and never the
charger's own entities. The wrappers currently read the go-e Charger's MQTT auto-discovery entities
(previously evcc, which republished too slowly to track a live session); swapping the source again is
a one-line change to the wrapper templates — no entity rename, no lost history, no dashboard edit.
The wrappers also normalise units from the source's own unit_of_measurement and supply the
state_class: total_increasing that go-e's discovery payload omits.
Custom Lovelace dashboards in YAML mode, loaded via configuration.yaml.
| File | URL | Purpose |
|---|---|---|
dashboards/Pergola-management.yaml |
/pergola-management |
Full pergola control panel: cover positions, sun angles, mode selector, state history |
dashboards/airflow-dashboard.yaml |
/airflow-monitoring |
Ventilation monitoring: ERV profile, humidity sensors, dew point, boost controls |
Dashboard element fragments live in dashboards/elements/ and are included via !include.
| Path | Purpose |
|---|---|
blueprints/automation/mine/loxone_inputs.yaml |
Bridges pergola cover and door-lock state to a Loxone Miniserver via REST |
blueprints/automation/homeassistant/ |
Standard HA-provided blueprints (motion light, zone departure notification) |
blueprints/script/homeassistant/ |
Standard HA-provided script blueprints (confirmable notification) |
Runs on every push. Validates the full configuration and executes the test suite against a live HA Docker instance.
- Pulls the pinned HA Docker image (cached by
.HA_VERSION) - Installs custom component dependencies listed in
tests/custom_components.yamlfrom GitHub - Copies
fakesecrets.yaml→secrets.yamlso the config loads without real credentials - Runs
homeassistant --script check_configto catch invalid configuration - Extracts all Jinja2 templates from YAML files into
/tmp/templates.json - Runs
pytest tests/against a session-scoped live HA container — covers template rendering correctness and automation scenario tests - Posts a PR comment with truncated pytest output on failure
- Writes full results to the Actions Job Summary
Runs on every push as a separate job chain.
- fix-yaml-style: auto-fixes trailing whitespace, CRLF line endings, and missing trailing newlines; commits the fixes back if any changes are detected
- lint-yaml: runs
yamllintwith the rules in.yamllint.yaml - lint-resolved: resolves all
!includedirectives inconfiguration.yamland dashboards (expanding to a flat file), then lints the resolved output — catches issues that only appear after include expansion
Credentials and local IP addresses are stored in secrets.yaml (excluded from the repository via .gitignore). The file fakesecrets.yaml contains placeholder entries used by CI in place of the real secrets file.
Copy fakesecrets.yaml to secrets.yaml and fill in your actual values before running Home Assistant locally.
The tests/ directory contains a pytest suite:
| File | Coverage |
|---|---|
test_templates.py |
Renders every state template and runtime template extracted from YAML; asserts no rendering errors |
test_pergola.py |
Automation scenarios for the pergola state machine (rain detection, frost lock, sun tracking transitions) |
test_airflow.py |
Automation scenarios for ventilation profile switching and humidity boost logic |
test_victron.py |
Template sensor correctness for energy accumulation and mode detection |
test_wallbox.py |
Wallbox wrapper sensors: unit normalisation (W/kW, Wh/kWh) and availability propagation |