You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Neues generisches SunSpec-Gerät (generic/sunspec) für Wechselrichter, Zähler und Speicher – herstellerunabhängig, im Gegensatz zum bestehenden fronius_sunspec (bleibt unverändert).
Liest das Gerät per SunSpec-Modellkette aus (offizielle Modelldefinitionen von sunspec.org, nicht hartkodierte Adressen) und erkennt automatisch, ob int+SF- oder Float-Modelle vorliegen. Speicher ist aktuell nur Telemetrie (Leistung/SoC über Model 802) – für aktive Steuerung gibt es im Standard kein Modell, das sowohl Telemetrie als auch Regelung abdeckt, ohne auf herstellerspezifische Register zurückzugreifen.
Summary by Sourcery
Introduce a generic SunSpec integration for vendor-independent inverter, meter, and battery telemetry.
New Features:
Add a vendor-neutral generic SunSpec device supporting inverter, meter, and battery components over Modbus TCP.
Support automatic SunSpec model-chain discovery and selection of standard integer/scale-factor or floating-point model variants.
Expose inverter telemetry, meter measurements and energy counters, and battery power and state-of-charge telemetry through the standard component interfaces.
Enhancements:
Handle SunSpec scaling factors, floating-point values, manufacturer-specific meter power direction, sentinel values, and incomplete phase data consistently.
Keep battery control disabled while providing read-only battery telemetry in accordance with the supported SunSpec model.
Tests:
Add unit coverage for SunSpec discovery, point decoding, scaling, sentinel handling, and generic inverter, meter, and battery behavior.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved battery register offsets, missing-phase handling, and Fronius power-direction errors can produce incorrect telemetry, crash meter updates, and misdirect surplus charging.
Adds a manufacturer-independent SunSpec device integration for inverters, meters, and battery telemetry alongside the unchanged Fronius-specific module.
Changes:
Introduces shared model-chain discovery and readers for integer-plus-scale-factor and floating-point measurements.
Adds configurable Modbus TCP components for inverter, meter, and model 802 battery telemetry; battery control remains unsupported.
Adds tests for discovery, decoding, and component updates.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active moderate findings show that valid SunSpec sentinel values can flow into arithmetic and peak-filter logic as None, causing TypeError instead of explicit invalid-update handling.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Three active moderate findings can cause unavailable SunSpec readings to publish None and crash downstream battery, frequency, or PV aggregation instead of preserving safe defaults or simulation values.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Handle unavailable battery SoC before building BatState
read_point returns None for the standard SoC not-implemented sentinel, but this value is passed directly into BatState. bat_all.calc_power_for_all_components unconditionally adds each battery's soc, so configuring a device that reports an unavailable SoC makes the aggregate update raise TypeError instead of publishing a usable state (the generic Modbus battery leaves the default SoC at 0 when its optional read is absent). Normalize the missing value before constructing BatState (or otherwise mark the component faulty).
Keep unavailable frequency readings from becoming None
read_point() deliberately converts an unimplemented Hz sentinel to None, but this value is passed explicitly into CounterState and reaches consumers that multiply/compare the frequency. An unavailable optional reading should leave the state default (50 Hz), or be rejected like the mandatory power reading; do not publish frequency=None.
Use the simulated export counter when WH is unavailable
read_point maps an unsupported/NaN SunSpec WH value to None, but the simulated exported value returned by sim_count is discarded here. That publishes InverterState.exported=None; control/pv_all.py later adds this field to the PV total and aborts aggregation. Use the simulated exported counter when the device does not provide WH (as the generic HTTP inverter does).
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
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.
UI: openWB/openwb-ui-settings#1154
Neues generisches SunSpec-Gerät (generic/sunspec) für Wechselrichter, Zähler und Speicher – herstellerunabhängig, im Gegensatz zum bestehenden fronius_sunspec (bleibt unverändert).
Liest das Gerät per SunSpec-Modellkette aus (offizielle Modelldefinitionen von sunspec.org, nicht hartkodierte Adressen) und erkennt automatisch, ob int+SF- oder Float-Modelle vorliegen. Speicher ist aktuell nur Telemetrie (Leistung/SoC über Model 802) – für aktive Steuerung gibt es im Standard kein Modell, das sowohl Telemetrie als auch Regelung abdeckt, ohne auf herstellerspezifische Register zurückzugreifen.
Summary by Sourcery
Introduce a generic SunSpec integration for vendor-independent inverter, meter, and battery telemetry.
New Features:
Enhancements:
Tests: