Wattpilot-Bruecke verwirft keine Messwerte mehr
Die Wallbox schickt 34 Statusfelder, die die API-Beschreibung von wattpilot 0.2 nicht kennt. Die Bibliothek schlug jedes Feld ungeprueft nach und lief in einen KeyError, der die restliche Schleife mitriss - alle Werte hinter dem unbekannten Feld derselben Nachricht kamen nie beim MQTT-Broker an. Im Dauerbetrieb traf es alle 15 Sekunden fhz, lps und tpcm, nach einem Verbindungsaufbau deutlich mehr; sichtbar war es nur als Fehlerpaar 'clea' im Log, rund ein MB am Tag. wattpilot_bruecke.py ersetzt die betroffene Funktion zur Laufzeit und ueberspringt unbekannte Felder, jedes einmal mit einer Warnung. Die Reparatur steht hier und nicht in site-packages, weil eine Neuinstallation sie dort spurlos zurueckdrehen wuerde und wattpilot 0.2 seit Mai 2022 die letzte Veroeffentlichung ist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+10
-3
@@ -27,11 +27,13 @@ fi
|
||||
|
||||
echo "Starting..."
|
||||
# Change the name of the script here
|
||||
SCRIPT_NAME="wattpilotshell"
|
||||
# Deckt auch den alten Aufruf ab, damit beim Umstieg keine zweite
|
||||
# Instanz stehen bleibt.
|
||||
SCRIPT_NAME="wattpilot_bruecke.py|wattpilotshell"
|
||||
LOG_FILE="wattpilotshell.log"
|
||||
|
||||
# Find the process ID of any running instance of the script
|
||||
PID=$(ps aux | grep "$SCRIPT_NAME" | grep -v grep | awk '{print $2}')
|
||||
PID=$(ps aux | grep -E "$SCRIPT_NAME" | grep -v grep | awk '{print $2}')
|
||||
|
||||
# If a running instance was found, kill it
|
||||
if [[ -n "$PID" ]]; then
|
||||
@@ -48,4 +50,9 @@ cd "$BASIS"
|
||||
# Loch aus Nullbytes in der Groesse des bisherigen Inhalts. Bei dieser Datei
|
||||
# faellt das besonders ins Gewicht - die wattpilotshell meldet einen
|
||||
# Verbindungsfehler im Sekundentakt und hatte es so auf 329 MB gebracht.
|
||||
/var/services/homes/wagner/.local/bin/wattpilotshell server >> "$LOG_FILE" 2>&1 &
|
||||
# Nicht mehr die wattpilotshell direkt: wattpilot_bruecke.py startet sie
|
||||
# ueber eine reparierte MQTT-Bruecke. Die Bibliothek stolpert sonst ueber
|
||||
# Statusfelder, die ihre API-Beschreibung von 2022 nicht kennt, und
|
||||
# verwirft dabei alle Werte, die in derselben Nachricht dahinter stehen.
|
||||
# Begruendung im Kopf von wattpilot_bruecke.py.
|
||||
/usr/local/bin/python3.10 "$BASIS/wattpilot_bruecke.py" server >> "$LOG_FILE" 2>&1 &
|
||||
|
||||
Reference in New Issue
Block a user