Skip to content

Solis Hybridwechselrichter S-Serie - #3284

Merged
LKuemmel merged 22 commits into
openWB:masterfrom
seaspotter:solis_fix
Jun 9, 2026
Merged

LKuemmel merged 22 commits into
openWB:masterfrom
seaspotter:solis_fix

Conversation

@seaspotter

Copy link
Copy Markdown
Collaborator

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

@LKuemmel LKuemmel added this to the 2.2.1 milestone Apr 13, 2026

@LKuemmel LKuemmel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@seaspotter

Copy link
Copy Markdown
Collaborator Author

Kannst Du bitte nochmal danach schauen?

Sollte jetzt gefixt sein das Problem Lena.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_s variant.
  • Updated inverter + battery modules to compute imported/exported energy via SimCounter and 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.

Comment on lines +40 to +46
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passt zur Doku

Comment on lines +50 to +51
self.peak_filter.check_values(power)
imported, exported = self.sim_counter.sim_count(power)
Comment on lines 20 to 23
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erledigt

Comment on lines +67 to +71
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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seaspotter Ist das richtig?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 20 to 33
@@ -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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erledigt

Comment on lines +78 to +80
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erledigt

@LKuemmel
LKuemmel merged commit 170dbd5 into openWB:master Jun 9, 2026
1 check passed
@seaspotter
seaspotter deleted the solis_fix branch June 9, 2026 09:09
ndrsnhs pushed a commit to ndrsnhs/core that referenced this pull request Aug 24, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants