From d1f47177fc347d2dc653ba92eca4c056fbcd258b Mon Sep 17 00:00:00 2001 From: retr0 <42kdesigners@gmail.com> Date: Tue, 28 Apr 2026 12:26:15 +0200 Subject: [PATCH] Fix: EMS aktiviert sich auch ohne lesbare charging_state (0x0060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - charging_state Default 0→1 (EV Connected) wenn Register nicht lesbar - EMS-Status auf INFO hochgestuft inkl. PV-Überschuss Co-Authored-By: Claude Sonnet 4.6 --- haos-addon/src/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/haos-addon/src/main.py b/haos-addon/src/main.py index 79029f7..988aee5 100644 --- a/haos-addon/src/main.py +++ b/haos-addon/src/main.py @@ -224,10 +224,12 @@ def _poll_loop(inv_cfg: Dict[str, Any], stop: threading.Event): # EMS: PV-Überschuss aus anderen Geräten holen und Ladestrom regeln if ems is not None and values is not None: pv_surplus = _get_pv_surplus() - charging_state = int(values.get("charging_state", 0)) + # 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) values["ems_status_code"] = float(charging_state) - log.debug("[%s] EMS: %s", inv_id, ems_status) + log.info("[%s] EMS: %s | PV-Überschuss: %.0fW", inv_id, ems_status, pv_surplus) with State.lock: d = State.inv_data.setdefault(inv_id, {"poll_count": 0})