123 lines
9.3 KiB
Markdown
123 lines
9.3 KiB
Markdown
---
|
||
title: "Home Assistant"
|
||
category: systems
|
||
tags: [homeassistant, smart-home, mqtt, automation]
|
||
created: "2026-09-27"
|
||
modified: "2026-09-27"
|
||
---
|
||
|
||
# Home Assistant
|
||
|
||
> Smart Home Zentrale auf Proxmox. Steuerung, Automatisierung und Benachrichtigungen.
|
||
|
||
## Infrastruktur
|
||
- **Host:** `10.0.30.10` (HAOS VM)
|
||
- **SSH:** `hassio@10.0.30.10` (PW: 1P Vault "Hermes")
|
||
- **URL:** `https://homeassistant.familie-schoen.com`
|
||
- **Container:** `homeassistant` (Docker)
|
||
|
||
## MQTT
|
||
- **Broker:** Mosquitto Add-on v7.1.1 auf localhost:1883
|
||
- **HA MQTT User:** ehemals `opendtu` (BROKEN — ACL blockiert), gefixt
|
||
- **ACL:** `/etc/mosquitto/acl` definiert `user homeassistant` + `user addons`
|
||
- **Auth Plugin:** `go-auth.so` (files,http backends)
|
||
|
||
## Automations
|
||
- **File:** `/config/automations.yaml` (35 Automations)
|
||
- **Schreibmethode:** SSH → `docker exec homeassistant chmod 666`, danach restore 644
|
||
- **Reload:** REST API mit JWT (HS256, signed from `/config/.storage/auth`)
|
||
|
||
### Frigate AI Notification v3 (ID 1714065780832)
|
||
- **Trigger:** MQTT `frigate/reviews` (severity=alert, Kameras Einfahrt/Terrasse) — NICHT `frigate/events` (Raw=Spam)
|
||
- **Gate:** llmvision.image_analyzer (noris gemma-4-31b-it) VOR Push, binär KRITISCH/NORMAL
|
||
- **Suppress:** sub_labels Sarah/Dominik; 300s Kamera-Cooldown; Review-ID-Dedup
|
||
- **Push:** GENAU EIN kombinierter (Titel+Verdict+Objekte+Bild) nur bei KRITISCH ∨ KI-Fail ∨ Person (24/7, v3.1)
|
||
- Siehe [[systems/frigate]] + Solution Doc `bug-fixes/2026-10-10-frigate-notification-spam-review-alerts.md`
|
||
|
||
## Notify Services
|
||
| Service | Status |
|
||
|---------|--------|
|
||
| `notify.mobile_app_iphone_dominik` | ✅ aktiv |
|
||
| `notify.mobile_app_sarahs_iphone_app` | verfügbar |
|
||
| `notify.mobile_app_ipad_2` | verfügbar |
|
||
| `notify.mobile_app_sm_x205` | verfügbar |
|
||
|
||
## Entitäten
|
||
- Kameras: `camera.einfahrt_2`, `camera.terrasse_2` (Suffix `_2` wegen verwaister Integration)
|
||
- Motion: `binary_sensor.einfahrt_motion_2`, `binary_sensor.terrasse_motion_2`
|
||
- Input Text: `input_text.frigate_last_event_id` (dedup storage, max 255 chars)
|
||
|
||
## Snapshots
|
||
- Gespeichert: `/config/www/snapshots/{camera}_latest.jpg`
|
||
- URL: `/local/snapshots/` (HTTP 200, keine Auth)
|
||
|
||
## JWT Auth
|
||
1. `jwt_key` aus `/config/.storage/auth` lesen
|
||
2. Client `Hermes_202606` (token id `1444b2c6757b4d66a6f8f8e5899b4e6a`)
|
||
3. HS256 signieren, Bearer Header
|
||
4. `?return_response=true` für Service-Call Responses
|
||
|
||
## Integrations
|
||
- Frigate (MQTT)
|
||
- LLM Vision (noris AI `gemma-4-31b-it`)
|
||
- Tibber (Strom)
|
||
- Marstek Speicher (VENUS-E, IP 10.0.50.113)
|
||
- NUT (APC Back-UPS ES 700G via ms-a2-1, `10.0.20.92:3493`, User monuser; Sensors `sensor.apc_*`; Entry `5e1d2138235140eb9b476e9d6779c228`; deployed via `iac-homelab/epic-9-ups-nut`)
|
||
- Various sensors (Xiaomi BLE, etc.)
|
||
|
||
## EMHASS Batteriesteuerung
|
||
- **Endpoint:** `http://10.0.30.10:5000` (v0.18.4)
|
||
- **Architektur:** EMHASS = Sole Optimizer. Virtuelle 16 kWh Batterie (BYD 11k + Marstek 5k).
|
||
- **Config API:** `POST /set-config` überschreibt GESAMTE Konfig (kein Partial-Update!). Immer alle Felder senden. Siehe Solution Doc `integrations/2026-10-02-emhass-set-config-overwrite-pitfall.md`.
|
||
- **Akuelle Config (2026-10-02):**
|
||
- Capacity 16000Wh, Charge/Discharge 6700W, Efficiency 0.9
|
||
- Target SoC 0.15 (15%), Min SoC 0.1, Max SoC 1.0
|
||
- `set_battery_dynamic: True`, `set_use_battery: True`
|
||
- SoC sensor: `sensor.total_soc`, Power sensor: `sensor.batteries_power_out_total`
|
||
- **Kaskaden-Automation** (`1774430238377`, ON): EMHASS target → BYD (803 Auto default, 802 bei `target<=0 && pv<100`) + Marstek (Rest via `sensor.marstek_target_power`)
|
||
- **Template Sensoren:** `sensor.smart_battery_target` (EMHASS), `sensor.marstek_target_power` (Plan A: smart_target − actual_BYD_discharge). `sensor.sma_target_power` ENTFERNT (Double-Counting Bug).
|
||
- **Cutover (2026-10-09):** v2 (`emhass_optimizer_v2.py --publish --allow-grid-charge`) ist EINZIGER Produzent; Cron `a32005d62226` (runner `emhass-optimizer-v2-runner.sh`). v1 + Shadow-Collector `d046e808f543` + Watchdog `19aef2351273` pausiert = Rollback-Hebel. Race-Guard 30/20 s. Details: [[reference/emhass-cascade-automation-architecture]]
|
||
- **Historie:** Phase-2 Shadow (08.10., Dual-Solve, Deferrables als Phantom-Last entfernt, CSV 17 Spalten); Arbitrage-Flip produktiv (08.10. 22:20, `set_nocharge_from_grid` false).
|
||
- **Backup:** `.bak.20261001_175804` für configuration.yaml + automations.yaml
|
||
- **NFS-Backups (Fix 2026-10-07):** Supervisor-Mounts `Backup_NFS` (usage=backup) + `Medien_NFS` (usage=media) → **10.0.20.100:/pool01_n2_redundant/HomeAssistant** (vorher tote 10.0.30.100, verloren beim NAS-Crash-Reboot 03.10.). Volle automatische Backups ~03:27 UTC nightly. Monitoring: Hermes-Cron `2006a91fba21` (Alert bei Backup-Alter >30h). Lösungsdoku: `docs/solutions/bug-fixes/2026-10-07-ha-audit-nfs-mount-failure-after-nas-crash.md`
|
||
|
||
## PV-Anlage & Forecasts (Stand 11.10.2026)
|
||
|
||
**Arrays/WR:**
|
||
|
||
| Array | WR | Strings | kWp/Real | Forecast-Lage |
|
||
|---|---|---|---|---|
|
||
| Dach Teil 1 | SMA SB SN 3006252807 (10.0.50.201) | 2 (A+B, je String Ausrichtung unklar, SO/SW-Mix) | ~5,7 kWp; 6,7 kWh/11.10. | nur via FS-Site "Dach Südwest" (225°/23°/5760 W) — Zuordnung zu WR unbelegt |
|
||
| Dach Teil 2 | SMA SB SN 3006252817 (10.0.50.203) | 2 (dto.) | ~4,0 kWp; 6,7 kWh/11.10. | FS-Site "Dach Südost" (145°/24°/4000 W) — Zuordnung unbelegt |
|
||
| Speicher | SMA SBS SN 3007105790 (10.0.50.202, BYD) | keine PV-Strings | — | n/a |
|
||
| Zelt | Hoymiles HM-1500 (OpenDTU 10.0.40.55) | 2 Module zeltartig SW/NE aneinandergelehnt | 1,5 kWp; 2,1 kWh | ❌ GAR KEIN Forecast |
|
||
| Schuppen 1 | Hoymiles HMS (Limit 2250 W) | SW, ~5° flach | 2,2 kWp; 2,9 kWh | FS-Site ✓ (225°/5°/2200) |
|
||
| Schuppen 2 | Hoymiles HMS (Limit 2250 W) | SW, ~5° flach | 2,64 kWp; 3,5 kWh | FS-Site ✓ (225°/5°/2640) |
|
||
|
||
Aggregation: `sensor.pv_production` = min_max über 5 Sensoren (2×SMA grid_power + 3×Hoymiles) ✓ korrekt.
|
||
⚠️ `sensor.pv_daily_energy_total` = SUMME der 3 SMA daily_yields OHNE Hoymiles (−11%) und inkl. SBS-Batteriedurchsatz — nicht als PV-Tagesertrag verwenden!
|
||
|
||
**Forecast-Systeme (3 parallel):**
|
||
1. **Solcast** (Custom, Entry `01KKTKEN0VAWQTQCS4WWCQJWPT`) = PV-Input für EMHASS-v2-Optimizer (pooled aus `*_prognose_heute/morgen/tag_3` detailedHourly). Sites: "Schön Rohr" (043e-b831-88bf-b087, 16 kW, Azimut -132,6°/Tilt 19°, Freystadt = gemittelte Gesamtanlage) AKTIV; "Ogdak Netherlands" (59c8-caae-52f5-1686, Solcast-DEMO-Site Apeldoorn/NL) seit 11.10. **excludiert** (war ~9,6/23,4 kWh Phantom-PV!). API-Quota 30/Tag (Site-getrieben), hard_limit 100.
|
||
2. **forecast.solar** (Core, 4 Subentries): Dach SW/SO, Schuppen 1/2 — Dashboard-only, kein Optimizer-Input. Nutzer-Beschluss 11.10.: **komplett neu bauen** (war unbedacht eingerichtet). Achtung: API liefert lokale Timestamps; HA-Sensoren zeigten +2h-versetzte Werte (physikalisch unmögliche "Resttag"-Energie nach Sonnenuntergang) — beim Rebuild prüfen.
|
||
3. **EMHASS-Addon intern** (open-meteo + pvlib, generisches Fronius/CSUN-Modell) — irrelevant, v2-Optimizer published eigene Pläne.
|
||
|
||
**Bekannte Issues (11.10.):**
|
||
- 🔴 TZ-Bug `emhass_optimizer_v2.py::build_pv_series`: Berlin-Wallclock-Keys werden als UTC re-tagged → +2h-Versatz im PV-Plan (numerisch bewiesen: Published 17:30=2384 W vs. richtig ~163 W). 1-Zeilen-Fix ausstehend (Approval): `replace(tzinfo=timezone.utc)` → `replace(tzinfo=BERLIN)` (Zeile ~246).
|
||
- 🟡 Solcast-Single-Site "Schön Rohr" = Mittelung (1 Azimut/Tilt für 6 Arrays mit SO/SW/flach-Mix) — Struktur grob falsch, Kalibrierung via auto_dampen derzeit aus.
|
||
- Solution Doc: `docs/solutions/integrations/2026-10-11-solcast-sample-site-contamination-and-tz-shift.md`
|
||
|
||
## Garagentor (free@home ch0003) — Flanken-Toggle-Semantik
|
||
- **Kanal:** `switch.garagentor` = free@home Schaltaktor `ABB20C351F51/ch0003`, treppenlicht-parametriert (Kanal nach Aktivierung AN bis Timer-Ablauf). `cover.garagentor` = Template-Cover darüber (open/close = je EINE Kanalaktivierung).
|
||
- **Motor toggelt auf JEDE Kanalflanke.** Einzelimpuls = sauber Umschalten (belegt: 17:51 Puls → schloss in ~90s). **Zwei schnelle Flanken = Start-Stopp** (belegt: 17:07 mein OFF→ON-Doppelpuls, 17:48 Nutzer-Doppelklick — jeweils blieb das Tor offen!). Doppelklick-Gewohnheit wirkt der Schließfahrt aktiv entgegen.
|
||
- **BUG (seit 05.10.):** `switch.garagentor` = `unknown`, 0 Logbook-Events — Statusrückmeldung SysAP→HA für ch0003 tot. SysAP-REST braucht Credentials (401 anon + admin/admin), SSH-Addon gestoppt → Diagnose dort blockiert.
|
||
- **Automations (2026-10-10, REST-config):** `warn_offen_beim_verlassen` (Person weg >2min + Garagentor/Esszimmertür offen → time-sensitive Push mit CLOSE_GARAGE-Button) + `garagentor_push_close` **v8 Single-Edge** (Guards: offen+90s stabil+45s Anti-Doppeltipp; EIN switch.turn_on, KEIN turn_off-Präludium; 45s-Verifikation per Neigungssensor; Retry erst nach 480s; ehrliche Fehler-Push). Tag `warn_offen_beim_verlassen` aktualisiert Notifications.
|
||
- Nur 2 physische Öffnungssensoren im Haus: Garagentor (Neigungssensor+Cover) + Esszimmertür (`binary_sensor.esszimertur_contact`, Aqara). free@home-Panels sind Taster, KEINE Fensterkontakte.
|
||
- Solution Doc: `docs/solutions/integrations/2026-10-10-freeathome-garage-impulse-toggle-semantics.md`
|
||
|
||
## Related
|
||
- [[systems/frigate]] — NVR Integration
|
||
- [[systems/noris-ai]] — LLM Vision Provider
|
||
- [[reference/ip-map]] — IP Assignments
|
||
- [[reference/emhass-cascade-automation-architecture]] — Kaskaden-Architektur Details
|