SMA NaN check for values at night#3675
Open
seaspotter wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes SMA Sunny Boy night-standby behavior where the inverter reports sentinel “NaN” values (e.g., -0x80000000) that previously triggered the peak filter and put the module into an error state (Issue #3674).
Changes:
- Extend SMA “NaN” sentinel constants (INT16/INT32/UINT32/UINT64).
- Treat sentinel “NaN” power readings as
0at night (and reset related values) to avoid peak filter errors. - Broaden the “NaN” detection for energy counters to include additional sentinel representations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+79
to
84
| # WR geht nachts in Standby und gibt einen NaN-Wert für die Leistung aus. | ||
| if power_total in (self.SMA_INT16_NAN, self.SMA_INT32_NAN, | ||
| -self.SMA_INT16_NAN * 10, -self.SMA_INT32_NAN): | ||
| power_total = 0 | ||
| # WR geht nachts in Standby und gibt einen NaN-Wert für die Leistung aus. | ||
| dc_power = 0 | ||
| currents = [0, 0, 0] |
| dc_power = 0 | ||
| currents = [0, 0, 0] | ||
| if energy == self.SMA_UINT32_NAN: | ||
| if energy in (self.SMA_UINT32_NAN, self.SMA_UINT32_NAN * 100, self.SMA_UINT64_NAN): |
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.
Fix for #3674