BYD-Speicher direkt aus der BMU auslesen
gatherBYDData.py fragt die BMU der HVM unter 192.168.16.254:8080 ab (BE-Connect-Protokoll, nach ioBroker.bydhvs): Ladestand und SOH laut BMU, 128 Zellspannungen, 64 Temperaturen, Spreizung, Ausgleich, Fehlerbits, Gesamtzaehler. Das Netzwerkmodul startet alle ~102 s neu und bedient nur die ersten Verbindungen danach - eigene Klopf-Schleife, ein Satz etwa alle 100 s. Werte unter solarManager/byd/#, Historie in byd und byd_zellen. tbatt kommt jetzt aus der BMU statt fest 0. mqttClient.publish legt ein einzelnes Dataclass-Objekt in rtData als Untertopics ab. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -54,7 +54,11 @@ def publish(dict,topic="solarManager"):
|
||||
mqttClient.publish(topic+"/"+key,value)
|
||||
else:
|
||||
for key, value in dict.items():
|
||||
if hasattr(value, '__len__') and (not isinstance(value, str)):
|
||||
# Ein einzelnes Dataclass-Objekt (z.B. rtData["byd"]) hat keine
|
||||
# Laenge und fiel frueher in den Zahlenzweig - "value is no number".
|
||||
if dataclasses.is_dataclass(value) and not isinstance(value, type):
|
||||
publish(value,topic+"/"+key)
|
||||
elif hasattr(value, '__len__') and (not isinstance(value, str)):
|
||||
if dataclasses.is_dataclass(value): #make subtopics of dataclasses
|
||||
publish(value,topic+"/"+key)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user