Initiale Infrastruktur-Dokumentation pve1 und pve2.
Enthält Host-Doku, MQTT/HA, Git-Setup, Power-Monitoring und GPU-Idle (pve2). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
# MQTT & Home Assistant
|
||||
|
||||
## Broker
|
||||
|
||||
| Parameter | Wert |
|
||||
|-----------|------|
|
||||
| Hostname | `homeassistant.iot` |
|
||||
| IP | 192.168.40.254 |
|
||||
| Port | 1883 (TLS: nicht verwendet) |
|
||||
| User | `server` |
|
||||
| Passwort | `F0x84rAOW#q@LX` |
|
||||
| Protokoll | MQTT v3.1.1, QoS 0, retained states |
|
||||
|
||||
Broker läuft auf dem **Home Assistant**-System (VM 106 auf pve2).
|
||||
|
||||
## Power-Sensoren (pve-power-mqtt)
|
||||
|
||||
Agent-Repo: https://git.jeanavril.com/jean/server-power.git
|
||||
|
||||
### Topics (Beispiel pve2)
|
||||
|
||||
```
|
||||
homeassistant/sensor/pve2/cpu_power/state
|
||||
homeassistant/sensor/pve2/gpu0_power/state
|
||||
homeassistant/sensor/pve2/gpu1_power/state
|
||||
homeassistant/sensor/pve2/estimated_total/state
|
||||
```
|
||||
|
||||
Discovery (retained):
|
||||
|
||||
```
|
||||
homeassistant/sensor/pve2_cpu_power/config
|
||||
homeassistant/sensor/pve2_gpu0_power/config
|
||||
...
|
||||
```
|
||||
|
||||
### HA-Geräte
|
||||
|
||||
| Gerät | Host | Sensoren |
|
||||
|-------|------|----------|
|
||||
| pve1 Power | pve1 | CPU, estimated_total |
|
||||
| pve2 Power | pve2 | CPU, GPU0, GPU1, estimated_total |
|
||||
|
||||
`estimated_total` = CPU (RAPL) + GPU-Summe — **kein** Wandverbrauch.
|
||||
|
||||
### Env auf den Hosts
|
||||
|
||||
Datei: `/etc/pve-power-mqtt.env` (chmod 600)
|
||||
|
||||
**pve2:**
|
||||
|
||||
```ini
|
||||
POWER_MQTT_BROKER=tcp://homeassistant.iot:1883
|
||||
POWER_MQTT_USER=server
|
||||
POWER_MQTT_PASSWORD="F0x84rAOW#q@LX"
|
||||
POWER_MQTT_HOSTNAME=pve2
|
||||
POWER_MQTT_DISCOVERY=true
|
||||
```
|
||||
|
||||
**pve1:**
|
||||
|
||||
```ini
|
||||
POWER_MQTT_BROKER=tcp://homeassistant.iot:1883
|
||||
POWER_MQTT_USER=server
|
||||
POWER_MQTT_PASSWORD="F0x84rAOW#q@LX"
|
||||
POWER_MQTT_HOSTNAME=
|
||||
POWER_MQTT_CLIENT_ID=
|
||||
POWER_MQTT_DISCOVERY=true
|
||||
```
|
||||
|
||||
Leere `HOSTNAME` / `CLIENT_ID` → automatisch `pve1` bzw. `pve-power-mqtt-pve1`.
|
||||
|
||||
### MQTT-Client-IDs (wichtig)
|
||||
|
||||
Jeder Host braucht eine **eindeutige** Client-ID, sonst „session taken over“ im Mosquitto-Log:
|
||||
|
||||
| Host | Client-ID |
|
||||
|------|-----------|
|
||||
| pve1 | `pve-power-mqtt-pve1` |
|
||||
| pve2 | `pve-power-mqtt-pve2` |
|
||||
|
||||
### Bekannte Mosquitto-Log-Meldungen
|
||||
|
||||
| Meldung | Bedeutung |
|
||||
|---------|-----------|
|
||||
| `session taken over` | Gleiche Client-ID von neuem Connect — prüfen ob Duplikat |
|
||||
| `exceeded timeout` | Keepalive verpasst — Agent reconnectet |
|
||||
| `pingresp not received` | Netz/Latenz VLAN 10↔40 — Keepalive im Agent auf 120 s |
|
||||
|
||||
### HA nach Agent-Update
|
||||
|
||||
**Einstellungen → Geräte & Dienste → MQTT → Neu laden**
|
||||
|
||||
Alte Discovery-Einträge mit `expire_after` oder `availability_topic` ggf. Entity löschen und neu discovern.
|
||||
Reference in New Issue
Block a user