diff --git a/haos-addon/src/main.py b/haos-addon/src/main.py index a11ebad..8eb66ad 100644 --- a/haos-addon/src/main.py +++ b/haos-addon/src/main.py @@ -522,7 +522,8 @@ def api_get_surplus_devices(): devices = State.surplus_devices_cfg z2m_base = State.z2m_base states = _surplus_ctrl.get_states() if _surplus_ctrl else {} - return jsonify({"devices": devices, "z2m_base": z2m_base, "states": states}) + surplus_w = _get_pv_surplus() + return jsonify({"devices": devices, "z2m_base": z2m_base, "states": states, "surplus_w": surplus_w}) @app.post("/api/surplus-devices") def api_save_surplus_devices(): diff --git a/haos-addon/src/web/index.html b/haos-addon/src/web/index.html index 957dac7..e2cfbbe 100644 --- a/haos-addon/src/web/index.html +++ b/haos-addon/src/web/index.html @@ -1079,10 +1079,15 @@ function renderSurplusStatus(surplusData) { `; }).join(''); if (!rows) return ''; + const surplusW = surplusData.surplus_w ?? null; + const surplusInfo = surplusW !== null + ? `${surplusW >= 0 ? '+' : ''}${Math.round(surplusW)} W Überschuss` + : ''; return `