Repository navigation
Peak Shaving: eingefrorener Netzwert und fehlende Akkuleistung gelten als Messausfall (Review B4, B10) - #83
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behebt B4 (hoch) und B10 aus dem Architektur-Review (Paket P5, Entscheidung D5: nur im Fork, keine Änderung in HA).
unavailableoder 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 HooksetPeakGridEnergymeldet dafür zusätzlich, ob die Netzleistung im Zyklus gelesen wurde (Vertragstest angepasst).// custom:-Hook incollectMeters– abweichend vom Konzept nicht inupdateBatteryMeters, 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 Quelle0stattunavailable. Der Fork erkennt das jetzt teilweise; sauberer wärehas_value()/availabilityin 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