6f52d46267
Enthält Host-Doku, MQTT/HA, Git-Setup, Power-Monitoring und GPU-Idle (pve2). Co-authored-by: Cursor <cursoragent@cursor.com>
80 lines
2.0 KiB
Markdown
80 lines
2.0 KiB
Markdown
# pve1 — Power-MQTT-Agent
|
|
|
|
CPU-Leistungsmessung (Intel RAPL) → MQTT → Home Assistant Auto-Discovery.
|
|
|
|
## Installation (Stand)
|
|
|
|
| Komponente | Pfad |
|
|
|------------|------|
|
|
| Binary | `/usr/local/bin/pve-power-mqtt` |
|
|
| systemd | `/etc/systemd/system/pve-power-mqtt.service` |
|
|
| Konfiguration | `/etc/pve-power-mqtt.env` |
|
|
| Quellcode | `/root/code/pve-power-mqtt` |
|
|
| Repo | https://git.jeanavril.com/jean/server-power.git |
|
|
|
|
## Konfiguration `/etc/pve-power-mqtt.env`
|
|
|
|
```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`** / **`pve-power-mqtt-pve1`**.
|
|
|
|
## MQTT-Sensoren in HA
|
|
|
|
| Entity (typisch) | Quelle |
|
|
|------------------|--------|
|
|
| sensor.pve1_cpu_power | RAPL package-0 |
|
|
| sensor.pve1_estimated_total | = CPU (kein GPU auf pve1) |
|
|
|
|
Topics: `homeassistant/sensor/pve1/cpu_power/state` usw.
|
|
|
|
Details Broker: [../shared/mqtt-homeassistant.md](../shared/mqtt-homeassistant.md)
|
|
|
|
## Build & Deploy (Update)
|
|
|
|
```bash
|
|
cd /root/code/pve-power-mqtt
|
|
git pull
|
|
export PATH="/usr/local/go/bin:$PATH"
|
|
go build -o pve-power-mqtt ./cmd/pve-power-mqtt
|
|
install -m 755 pve-power-mqtt /usr/local/bin/pve-power-mqtt
|
|
systemctl restart pve-power-mqtt
|
|
```
|
|
|
|
Oder aus Repo:
|
|
|
|
```bash
|
|
cd /root/code/pve-power-mqtt
|
|
git pull && ./deploy/install.sh
|
|
systemctl restart pve-power-mqtt
|
|
```
|
|
|
|
## Betrieb
|
|
|
|
```bash
|
|
systemctl status pve-power-mqtt
|
|
journalctl -u pve-power-mqtt -f
|
|
```
|
|
|
|
Intervall: CPU alle **5 s**.
|
|
|
|
## Unterschied zu pve2
|
|
|
|
- **Kein** `nvidia-smi` — nur RAPL
|
|
- Kein `nvidia-persistenced`
|
|
- Keine GPU-Topics
|
|
|
|
## Troubleshooting
|
|
|
|
| Problem | Lösung |
|
|
|---------|--------|
|
|
| HA „unavailable“ | MQTT neu laden; `journalctl -u pve-power-mqtt` auf Connect-Fehler |
|
|
| session taken over | Client-ID prüfen — muss `pve-power-mqtt-pve1` sein |
|
|
| RAPL fehlt | `ls /sys/class/powercap/intel-rapl/` — Intel-CPU erforderlich |
|