Skip to content

Peak Shaving: eingefrorener Netzwert und fehlende Akkuleistung gelten als Messausfall (Review B4, B10) - #83

Merged
SolarPower2024 merged 2 commits into
load-peak-featuresfrom
review/messausfall
Oct 12, 2026
Merged

SolarPower2024 merged 2 commits into
load-peak-featuresfrom
review/messausfall

Conversation

@SolarPower2024

Copy link
Copy Markdown
Owner

Behebt B4 (hoch) und B10 aus dem Architektur-Review (Paket P5, Entscheidung D5: nur im Fork, keine Änderung in HA).

  • B4: Meldet die HA-Netzleistung unavailable oder bleibt sie bitgleich stehen, während sich die Akkuleistung um mehr als 500 W ändert, gilt das jetzt als Zählerausfall: der bestehende Ausfallpfad greift (Freiwert, Netzladen pausiert) statt einer Rückkopplung, die die Reserve leert. Der vorhandene Hook setPeakGridEnergy meldet dafür zusätzlich, ob die Netzleistung im Zyklus gelesen wurde (Vertragstest angepasst).
  • B10: Ein Lesefehler der Akkuleistung wird gemeldet (neuer // custom:-Hook in collectMeters – abweichend vom Konzept nicht in updateBatteryMeters, weil nur dort der Fehler bekannt ist); der letzte Sollwert bleibt, nach 2 min Freiwert und Netzladen pausiert. Touch-Point-Tabelle, forkHooks, Vertragstest.

Tests: Szenariotests mit eingefrorenem Netzwert und fehlender Akkuleistung, Vertragstests beider Hooks. wsltest.sh ./core/ ./core/peak/ grün.

Code-Review (Opus, mittel): keine Funde mittel oder höher. Offen (niedrig): der B10-Hook hängt am Literal "battery" ohne Vertragstest für den Aufrufer; die Stillstandserkennung nutzt nach Pause oder Ausfall einen älteren Startpunkt.

Live-Hinweis (du-Punkt, D5): Die HA-Templates "evcc grid meter", "Leistung Bezug KBH" und "marstek grid meter omnibattery" liefern bei einer fehlenden Quelle 0 statt unavailable. Der Fork erkennt das jetzt teilweise; sauberer wäre has_value()/availability in HA – nur nach deinem Ja.

Für das Add-on (CHANGELOG): Peak Shaving: ein stehender oder nicht verfügbarer Netzwert und eine nicht lesbare Akkuleistung gelten als Messausfall, die Batterie wird dann freigegeben statt die Reserve zu leeren.

Merge nach P4, vor P6 (P6/B18 rechnet mit dem erlaubten Wert des Fensters).

🤖 Generated with Claude Code

SolarPower2024 and others added 2 commits October 11, 2026 22:36
…s as an outage (B4)

A grid meter that answers "not available" (Home Assistant sensor unavailable
or unknown) is no failure for evcc, which keeps the last grid power. Peak
shaving renewed its time of the last meter values anyway, so the meters-lost
path never fired and the setpoint integrated on the old value cycle by cycle
(1000, 2034, 3105 ... W) until the reserve was gone before the real peak.

The hook setPeakGridEnergy reports now whether the power was read this cycle
(powerRead in updateGridMeter). Without it the cycle meters nothing, keeps
the setpoint and does not renew the time of the last values, so after 2
minutes the free value is written and grid charging pauses, as for a failing
meter. A grid power that is a real number but stays exactly the same for over
2 minutes while the battery power moves by more than 500 W counts as the same
outage, from the start of the standstill. Logged once per cause.

README section 11 and the help text of the energy counter field: template
sensors have to report unavailable on failure, not 0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (B10)

When reading the battery power fails, evcc leaves it at 0 W without a mark,
for an unavailable Home Assistant sensor without even a log line. The setpoint
adds the battery power back, so with a battery that keeps following it the
setpoint jumped between the value with and without the battery (3000, 0,
3107, 0 W), wrote to Home Assistant every cycle and ended the window above the
limit. The meters-lost path only sees the grid meter.

New hook setPeakMeterRead in collectMeters takes the result of each power read
(the failure is only known there); a battery that cannot be read counts as a
meter outage like the grid cases of the change before: the cycle keeps the
last setpoint, after 2 minutes the free value is written and grid charging
pauses. A read that fails now and then, with values in between, hands nothing
back. Logged once per cause.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SolarPower2024
SolarPower2024 merged commit 86aec20 into load-peak-features Oct 12, 2026
6 checks passed
@SolarPower2024
SolarPower2024 deleted the review/messausfall branch October 12, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant