From cd0bf094cd21bf1b094b844b4a563959587ac6bd Mon Sep 17 00:00:00 2001 From: Marco Bungalski Date: Sat, 25 Oct 2025 15:06:42 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Fix=20SMA=20Data-Manager/Cluster-Controller?= =?UTF-8?q?/Core2=20-=20The=20"currents"=20array=20is=20set=20on=20the=20D?= =?UTF-8?q?ata=20Manager/Cluster=20Controller.=20Since=20there=20is=20no?= =?UTF-8?q?=20Modbus=20register,=20the=20values=20=E2=80=8B=E2=80=8Bare=20?= =?UTF-8?q?calculated=20based=20on=20the=20power.=20-=20The=20"currents"?= =?UTF-8?q?=20array=20is=20read=20and=20set=20on=20the=20Core2=20inverter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/devices/sma/sma_sunny_boy/inverter.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/modules/devices/sma/sma_sunny_boy/inverter.py b/packages/modules/devices/sma/sma_sunny_boy/inverter.py index 5c3b206d0d..c9bb320781 100644 --- a/packages/modules/devices/sma/sma_sunny_boy/inverter.py +++ b/packages/modules/devices/sma/sma_sunny_boy/inverter.py @@ -66,7 +66,13 @@ def read(self) -> InverterState: power_total = self.tcp_client.read_holding_registers(40084, ModbusDataType.INT_16, unit=unit) * 10 # Gesamtertrag (Wh) [E-Total] SF=2! energy = self.tcp_client.read_holding_registers(40094, ModbusDataType.UINT_32, unit=unit) * 100 + # Power dc_power = self.tcp_client.read_holding_registers(40101, ModbusDataType.UINT_32, unit=unit) * 100 + # Phasenstöme + current_L1 = self.tcp_client.read_holding_registers(30977, ModbusDataType.INT_32, unit=unit) * -1 + current_L2 = self.tcp_client.read_holding_registers(30979, ModbusDataType.INT_32, unit=unit) * -1 + current_L3 = self.tcp_client.read_holding_registers(30981, ModbusDataType.INT_32, unit=unit) * -1 + currents = [current_L1 / 1000, current_L2 / 1000, current_L3 / 1000] elif self.component_config.configuration.version == SmaInverterVersion.datamanager: # AC Wirkleistung über alle Phasen (W) [Pac] power_total = self.tcp_client.read_holding_registers(30775, ModbusDataType.INT_32, unit=unit) @@ -76,6 +82,12 @@ def read(self) -> InverterState: # daher ist wie bei SmaInverterVersion.default keine Prüfung auf DC-Leistung notwendig. # Aus kompatibilitätsgründen wird dc_power auf den Wert der AC-Wirkleistung gesetzt. dc_power = power_total + # Der Data-Manager/Cluster-Controller bietet keine Modbus-Register mit Phasenströmen an. + # Daher die Phasenströme berechnen (es wird davon ausgegangen, dass eine symmetrische Erzeugung erfolgt) + current_L1 = (power_total / 3 / 230) * -1 + current_L2 = (power_total / 3 / 230) * -1 + current_L3 = (power_total / 3 / 230) * -1 + currents = [current_L1, current_L2, current_L3] else: raise ValueError("Unbekannte Version "+str(self.component_config.configuration.version)) if power_total == self.SMA_INT32_NAN or power_total == self.SMA_NAN: From 0e3f893b595c7027928978ca8ebd7413ad27ff96 Mon Sep 17 00:00:00 2001 From: Marco Bungalski <131010688+MBungalski@users.noreply.github.com> Date: Mon, 27 Oct 2025 21:08:45 +0100 Subject: [PATCH 2/4] Update packages/modules/devices/sma/sma_sunny_boy/inverter.py Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com> --- packages/modules/devices/sma/sma_sunny_boy/inverter.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/modules/devices/sma/sma_sunny_boy/inverter.py b/packages/modules/devices/sma/sma_sunny_boy/inverter.py index c9bb320781..87b353996c 100644 --- a/packages/modules/devices/sma/sma_sunny_boy/inverter.py +++ b/packages/modules/devices/sma/sma_sunny_boy/inverter.py @@ -84,10 +84,7 @@ def read(self) -> InverterState: dc_power = power_total # Der Data-Manager/Cluster-Controller bietet keine Modbus-Register mit Phasenströmen an. # Daher die Phasenströme berechnen (es wird davon ausgegangen, dass eine symmetrische Erzeugung erfolgt) - current_L1 = (power_total / 3 / 230) * -1 - current_L2 = (power_total / 3 / 230) * -1 - current_L3 = (power_total / 3 / 230) * -1 - currents = [current_L1, current_L2, current_L3] + currents = [(power_total / 3 / 230) * -1] * 3 else: raise ValueError("Unbekannte Version "+str(self.component_config.configuration.version)) if power_total == self.SMA_INT32_NAN or power_total == self.SMA_NAN: From 837776db53bb3c757441c2b8910440df7aa251c3 Mon Sep 17 00:00:00 2001 From: Marco Bungalski <131010688+MBungalski@users.noreply.github.com> Date: Mon, 27 Oct 2025 21:08:53 +0100 Subject: [PATCH 3/4] Update packages/modules/devices/sma/sma_sunny_boy/inverter.py Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com> --- packages/modules/devices/sma/sma_sunny_boy/inverter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/modules/devices/sma/sma_sunny_boy/inverter.py b/packages/modules/devices/sma/sma_sunny_boy/inverter.py index 87b353996c..b7fc336f98 100644 --- a/packages/modules/devices/sma/sma_sunny_boy/inverter.py +++ b/packages/modules/devices/sma/sma_sunny_boy/inverter.py @@ -69,10 +69,8 @@ def read(self) -> InverterState: # Power dc_power = self.tcp_client.read_holding_registers(40101, ModbusDataType.UINT_32, unit=unit) * 100 # Phasenstöme - current_L1 = self.tcp_client.read_holding_registers(30977, ModbusDataType.INT_32, unit=unit) * -1 - current_L2 = self.tcp_client.read_holding_registers(30979, ModbusDataType.INT_32, unit=unit) * -1 - current_L3 = self.tcp_client.read_holding_registers(30981, ModbusDataType.INT_32, unit=unit) * -1 - currents = [current_L1 / 1000, current_L2 / 1000, current_L3 / 1000] + currents = [self.tcp_client.read_holding_registers(r, ModbusDataType.INT_32, unit=unit) / -1000 + for r in (30977, 30979, 30981)] elif self.component_config.configuration.version == SmaInverterVersion.datamanager: # AC Wirkleistung über alle Phasen (W) [Pac] power_total = self.tcp_client.read_holding_registers(30775, ModbusDataType.INT_32, unit=unit) From 96758465705c518102d73e5dd792ccbcaf3f5d5e Mon Sep 17 00:00:00 2001 From: Marco Bungalski Date: Tue, 28 Oct 2025 12:27:48 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Probleme=20mit=20Einr=C3=BCckung=20korrigie?= =?UTF-8?q?rt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/modules/devices/sma/sma_sunny_boy/inverter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/modules/devices/sma/sma_sunny_boy/inverter.py b/packages/modules/devices/sma/sma_sunny_boy/inverter.py index b7fc336f98..87b353996c 100644 --- a/packages/modules/devices/sma/sma_sunny_boy/inverter.py +++ b/packages/modules/devices/sma/sma_sunny_boy/inverter.py @@ -69,8 +69,10 @@ def read(self) -> InverterState: # Power dc_power = self.tcp_client.read_holding_registers(40101, ModbusDataType.UINT_32, unit=unit) * 100 # Phasenstöme - currents = [self.tcp_client.read_holding_registers(r, ModbusDataType.INT_32, unit=unit) / -1000 - for r in (30977, 30979, 30981)] + current_L1 = self.tcp_client.read_holding_registers(30977, ModbusDataType.INT_32, unit=unit) * -1 + current_L2 = self.tcp_client.read_holding_registers(30979, ModbusDataType.INT_32, unit=unit) * -1 + current_L3 = self.tcp_client.read_holding_registers(30981, ModbusDataType.INT_32, unit=unit) * -1 + currents = [current_L1 / 1000, current_L2 / 1000, current_L3 / 1000] elif self.component_config.configuration.version == SmaInverterVersion.datamanager: # AC Wirkleistung über alle Phasen (W) [Pac] power_total = self.tcp_client.read_holding_registers(30775, ModbusDataType.INT_32, unit=unit)