97 lines
6.5 KiB
Markdown
97 lines
6.5 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`
|
||
|
||
## 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
|