Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0dbf0266a8 |
@@ -1,5 +1,5 @@
|
|||||||
name: ShineBridge
|
name: ShineBridge
|
||||||
version: "1.8.10"
|
version: "1.8.11"
|
||||||
slug: shinebridge
|
slug: shinebridge
|
||||||
description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI
|
description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI
|
||||||
url: https://gitea.bitfire.work/retr0/shinebridge
|
url: https://gitea.bitfire.work/retr0/shinebridge
|
||||||
|
|||||||
+3
-19
@@ -180,25 +180,9 @@ def _compute_aggregates(allow_stale: bool = False) -> Dict[str, float]:
|
|||||||
# ── EMS Hilfsfunktionen ───────────────────────────────────────
|
# ── EMS Hilfsfunktionen ───────────────────────────────────────
|
||||||
|
|
||||||
def _get_pv_surplus() -> float:
|
def _get_pv_surplus() -> float:
|
||||||
"""PV-Überschuss in Watt aus laufenden Geräten ermitteln.
|
"""PV-Überschuss in Watt. Nutzt grid_power-Aggregat (negativ = Einspeisung)."""
|
||||||
Goodwe: active_power negativ = Einspeisung (Überschuss).
|
agg = _compute_aggregates(allow_stale=True)
|
||||||
Growatt: power_to_grid positiv = Einspeisung.
|
return max(0.0, -agg.get("grid_power", 0.0))
|
||||||
"""
|
|
||||||
surplus = 0.0
|
|
||||||
with State.lock:
|
|
||||||
for inv_cfg in State.inverters_cfg:
|
|
||||||
d = State.inv_data.get(inv_cfg["id"], {})
|
|
||||||
if not d.get("modbus_ok") or not d.get("values"):
|
|
||||||
continue
|
|
||||||
v = d["values"]
|
|
||||||
# Goodwe ET: active_power > 0 = Einspeisung, < 0 = Netzbezug
|
|
||||||
# house_consumption = ppv + pbattery1 - active_power (Bibliotheks-Formel)
|
|
||||||
if "active_power" in v:
|
|
||||||
surplus += max(0.0, v["active_power"])
|
|
||||||
# Growatt
|
|
||||||
if "power_to_grid" in v:
|
|
||||||
surplus += max(0.0, v["power_to_grid"])
|
|
||||||
return surplus
|
|
||||||
|
|
||||||
|
|
||||||
# ── Poll Loop ─────────────────────────────────────────────────
|
# ── Poll Loop ─────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user