Integrationen
REST API
Section titled “REST API”Der PC Restarter bietet eine REST-API zur Steuerung und Statusabfrage.
Basis-URL: http://pc-restarter.local/api
| Endpoint | Funktion |
|---|---|
GET /api/status | Gerätestatus abrufen |
POST /api/power/on | PC einschalten |
POST /api/power/off | PC ausschalten |
POST /api/power/reset | PC neu starten |
GET /api/info | Geräteinformationen abrufen |
Beispiel:
curl -X POST http://pc-restarter.local/api/power/onFür Smart-Home- und Automatisierungsplattformen wird MQTT unterstützt.
| Topic | Inhalt |
|---|---|
pc-restarter/status | Gerätestatus (JSON) |
pc-restarter/power/command | Befehle: on, off, reset |
pc-restarter/power/state | Aktueller Schaltzustand |
Konfiguration: Web-Interface unter Einstellungen -> MQTT.
Home Assistant
Section titled “Home Assistant”Die Integration in Home Assistant ist direkt möglich. Eine Schritt-für-Schritt-Anleitung kann über die Projektseite bereitgestellt werden.
Prometheus und Grafana
Section titled “Prometheus und Grafana”Metriken stehen unter folgendem Endpoint zur Verfügung:
http://pc-restarter.local/metrics
Typische Metriken:
pc_restarter_uptime_secondspc_restarter_power_statepc_restarter_wifi_rssipc_restarter_temperature_celsius
Grafana-Anbindung erfolgt über Prometheus als Datenquelle.
Loki Logging
Section titled “Loki Logging”Optional können Logs an Loki gesendet werden.
- Konfiguration im Web-Interface unter
Einstellungen -> Logging - Log-Level:
ERROR,WARN,INFO,DEBUG - Format: JSON-Logs mit Zeitstempel und Level