Fix: Batterie-Flussrichtung via Nettoleistung (v1.7.3)

Vorher: rev:dchOn — bei gleichzeitig aktiven bat_charge/discharge (Messrauschen)
zeigte die Richtung Entladen obwohl Laden aktiv war.
Jetzt: rev:!(batChW >= batDchW) — Richtung folgt dem Nettostrom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
retr0
2026-04-29 07:46:46 +02:00
parent 2464c304c4
commit 0d29739fc8
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: ShineBridge name: ShineBridge
version: "1.7.2" version: "1.7.3"
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
+2 -1
View File
@@ -404,6 +404,7 @@ function renderEnergy(inverters, aggregates, period) {
const expOn = gridExport > T; const expOn = gridExport > T;
const chOn = batChW > T; const chOn = batChW > T;
const dchOn = batDchW > T; const dchOn = batDchW > T;
const batFlowIn = batChW >= batDchW; // true = Laden (Haus→Bat), false = Entladen (Bat→Haus)
const evOn = evW > T; const evOn = evW > T;
const C = { const C = {
@@ -471,7 +472,7 @@ function renderEnergy(inverters, aggregates, period) {
const SEG = [ const SEG = [
{ id:'ep-pv', d:`M 260,134 C 258,148 262,148 260,162`, col:C.pv, on:pvOn, rev:false }, { id:'ep-pv', d:`M 260,134 C 258,148 262,148 260,162`, col:C.pv, on:pvOn, rev:false },
{ id:'ep-grid', d:`M 170,224 C 182,220 186,228 198,224`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn }, { id:'ep-grid', d:`M 170,224 C 182,220 186,228 198,224`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn },
{ id:'ep-bat', d:`M 322,224 C 334,220 338,228 350,224`, col:C.bat, on:chOn||dchOn, rev:dchOn }, { id:'ep-bat', d:`M 322,224 C 334,220 338,228 350,224`, col:C.bat, on:chOn||dchOn, rev:!batFlowIn },
...(hasEV ? [{ id:'ep-ev', d:`M 260,286 C 258,300 262,300 260,314`, col:C.ev, on:evOn, rev:false }] : []), ...(hasEV ? [{ id:'ep-ev', d:`M 260,286 C 258,300 262,300 260,314`, col:C.ev, on:evOn, rev:false }] : []),
]; ];