Fix: EMS Ladestrom = PV-Überschuss + aktuelle Wallbox-Leistung

Goodwe misst Überschuss NACH Wallbox-Verbrauch. EMS muss deshalb
bestehende Ladeleistung (total_power) addieren um Gesamtbudget zu kennen:
  new_current = (surplus + wallbox_power) / (230V × phases)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
retr0
2026-04-28 13:22:57 +02:00
parent 20d935bd73
commit ff428145f4
2 changed files with 16 additions and 8 deletions
+2 -1
View File
@@ -228,7 +228,8 @@ def _poll_loop(inv_cfg: Dict[str, Any], stop: threading.Event):
# 0x0060 manchmal nicht lesbar → 1 (EV Connected) annehmen,
# damit EMS aktiviert; Wallbox ignoriert Befehle wenn kein Auto da
charging_state = int(values.get("charging_state", 1))
ems_status = ems.update(reader, pv_surplus, charging_state)
wallbox_power = values.get("total_power", 0.0)
ems_status = ems.update(reader, pv_surplus, charging_state, wallbox_power)
values["ems_status_code"] = float(charging_state)
log.info("[%s] EMS: %s | PV-Überschuss: %.0fW", inv_id, ems_status, pv_surplus)