Repository navigation
Solis Hybridwechselrichter S-Serie - #3284
Conversation
Added current readings for hybrid inverter versions and adjusted calculations accordingly.
LKuemmel
left a comment
There was a problem hiding this comment.
Beim Testen bekomme ich beim WR und Speicher folgenden Fehler:
2026-06-03 14:11:00,173 - {modules.common.configurable_device:129} - {ERROR:device1} - Initialisierung der Komponente <modules.devices.solis.solis.bat.SolisBat object at 0xffff954bb280> fehlgeschlagen Traceback (most recent call last): File "/var/www/html/openWB/packages/modules/common/configurable_device.py", line 125, in update component.initialize() File "/var/www/html/openWB/packages/modules/devices/solis/solis/bat.py", line 32, in initialize self.version: SolisVersion = self.kwargs['version'] KeyError: 'version' 2026-06-03 14:11:00,174 - {modules.common.configurable_device:129} - {ERROR:device1} - Initialisierung der Komponente <modules.devices.solis.solis.inverter.SolisInverter object at 0xffff9440c520> fehlgeschlagen Traceback (most recent call last): File "/var/www/html/openWB/packages/modules/common/configurable_device.py", line 125, in update component.initialize() File "/var/www/html/openWB/packages/modules/devices/solis/solis/inverter.py", line 29, in initialize self.sim_counter = SimCounter(self.component_config.id) TypeError: __init__() missing 2 required positional arguments: 'component_id' and 'prefix'
Kannst Du bitte nochmal danach schauen?
Removed version attribute from kwargs and refactored its usage in initialize and update methods.
Updated component creation functions to include device_id.
Sollte jetzt gefixt sein das Problem Lena. |
There was a problem hiding this comment.
Pull request overview
This PR extends the Solis device integration to support a separate Hybrid S-Series variant and adjusts energy accounting to use simulated counters (SimCounter) for PV/battery where register resolution is insufficient. It also introduces battery power limiting control for the S-Series.
Changes:
- Added a new
SolisVersion.hybrid_svariant. - Updated inverter + battery modules to compute
imported/exportedenergy viaSimCounterand added additional telemetry (DC power, phase currents). - Added battery power-limit control logic intended for S-Series devices.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/devices/solis/solis/version.py | Adds hybrid_s enum value for the new Solis variant. |
| packages/modules/devices/solis/solis/inverter.py | Switches inverter register mapping, adds DC power/currents, and replaces exported register usage with SimCounter. |
| packages/modules/devices/solis/solis/device.py | Wires additional constructor args (device_id, version passthrough) into components. |
| packages/modules/devices/solis/solis/counter.py | Removes redundant assignments in initialization. |
| packages/modules/devices/solis/solis/bat.py | Switches battery energy counters to SimCounter, adds currents, and introduces power-limit control + controllability gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| power = self.client.read_input_registers(3004, ModbusDataType.INT_32, unit=unit) * -1 | ||
| dc_power = self.client.read_input_registers(3006, ModbusDataType.UINT_32, unit=unit) * -1 | ||
| currents = self.client.read_input_registers(3036, [ModbusDataType.UINT_16]*3, unit=unit) | ||
| elif self.version in (SolisVersion.hybrid, SolisVersion.hybrid_s): | ||
| power = self.client.read_input_registers(33079, ModbusDataType.INT_32, unit=unit) * -1 | ||
| dc_power = self.client.read_input_registers(33057, ModbusDataType.UINT_32, unit=unit) * -1 | ||
| currents = self.client.read_input_registers(33076, [ModbusDataType.UINT_16]*3, unit=unit) |
| self.peak_filter.check_values(power) | ||
| imported, exported = self.sim_counter.sim_count(power) |
| def create_bat_component(component_config: SolisBatSetup): | ||
| nonlocal client | ||
| return SolisBat(component_config, client=client) | ||
| return SolisBat(component_config, client=client, device_id=device_config.id) | ||
|
|
| elif power_limit < 0: | ||
| self.client.write_register(43135, 2, data_type=ModbusDataType.UINT_16, unit=unit) | ||
| power_value = int(power_limit / 10) | ||
| self.client.write_register(43129, power_value, data_type=ModbusDataType.UINT_16, unit=unit) | ||
| log.debug(f"Aktive Batteriesteuerung. Batterie wird mit {power_value} W entladen für den Hausverbrauch") |
There was a problem hiding this comment.
Ja Copilot hat rechts es muss der absolut Wert übergeben werden, es gibt für Charging und Discharging 2 Register jeweils u16 also erwarten beide einen positiven Wert
| @@ -26,6 +29,7 @@ def __init__(self, component_config: SolisBatSetup, **kwargs: Any) -> None: | |||
|
|
|||
| def initialize(self) -> None: | |||
| self.client: ModbusTcpClient_ = self.kwargs['client'] | |||
| self.sim_counter = SimCounter(self.kwargs['device_id'], self.component_config.id, prefix="speicher") | |||
| self.store = get_bat_value_store(self.component_config.id) | |||
| def power_limit_controllable(self) -> bool: | ||
| # Nur die S-Serie sollte die Speichersteuerung können | ||
| return SolisVersion(self.component_config.configuration.version) == SolisVersion.hybrid_s |
* Add 'hybrid-s' option to SolisVersion enum * Rename hybrid-s to hybrid_s in SolisVersion * Enhance inverter.py to read currents for hybrid models Added current readings for hybrid inverter versions and adjusted calculations accordingly. * Add SimCounter import to inverter.py * Refactor battery state handling and add power limit control * Add SolisVersion to KwargsDict and initialize method * Fixes * Fixes * Update inverter.py for Modbus register changes * Fix errors * Refactor SolisInverter to use device_id and version * Refactor SolisCounter to remove version from kwargs Removed version attribute from kwargs and refactored its usage in initialize and update methods. * Refactor peak_filter usage in bat.py * Refactor peak_filter usage in inverter.py * Add device_id to component creation functions Updated component creation functions to include device_id. * flake8 * flake8 * flake8 * fix: version setting in device config * flake8 * fix version for bat * Fix power limit calculation for battery control --------- Co-authored-by: LKuemmel <[email protected]>
UI PR: openWB/openwb-ui-settings#947
https://forum.openwb.de/viewtopic.php?t=12065
Solis Hybrid S-Serie herausgetrennt und alle Counter auf simcounter umgestellt, da in der Doku für alle Register nur eine Auflösung von 1kWh angegeben sind
Speichersteuerung für S-Serie hinzugefügt, aber mangels Hardware nicht getestet
Doku für S-Serie Register: https://github.com/peufeu2/GrugBus/blob/main/grugbus/devices/Solis_S5_EH1P_6K_2020.csv