Skip to content

Commit 9eafb3e

Browse files
seaspotterLKuemmel
andcommitted
Revert ValueError for NaN values SMA (openWB#2887)
* Handle invalid power_total by resetting values Set power_total to 0 and currents to [0, 0, 0] when power_total is not valid. * Helptext improved Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com> --------- Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
1 parent 3a43ad2 commit 9eafb3e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/modules/devices/sma/sma_sunny_boy/inverter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def read(self) -> InverterState:
8181
else:
8282
raise ValueError("Unbekannte Version "+str(self.component_config.configuration.version))
8383
if power_total == self.SMA_INT32_NAN or power_total == self.SMA_NAN:
84-
raise ValueError(f'Wechselrichter lieferte nicht plausiblen Leistungswert: {power_total}.')
85-
84+
power_total = 0
85+
# WR geht nachts in Standby und gibt einen NaN-Wert für die Leistung aus.
86+
currents = [0, 0, 0]
8687
if energy == self.SMA_UINT32_NAN:
8788
raise ValueError(
8889
f'Wechselrichter lieferte nicht plausiblen Zählerstand: {energy}. '

0 commit comments

Comments
 (0)