Skip to content

Commit

Permalink
Merge pull request snaptec#2693 from MBungalski/feature-sma-data-manager
Browse files Browse the repository at this point in the history
Added new version in PV Module: SMA Cluster Controller/Data Manager
  • Loading branch information
LKuemmel authored Jun 15, 2023
2 parents 0e55c4f + 7125121 commit 01d9a4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/modules/devices/sma_sunny_boy/inv_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
class SmaInverterVersion(IntEnum):
default = 0
core2 = 1
datamanager = 2
9 changes: 9 additions & 0 deletions packages/modules/devices/sma_sunny_boy/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def read(self) -> InverterState:
# Gesamtertrag (Wh) [E-Total] SF=2!
energy = self.tcp_client.read_holding_registers(40094, ModbusDataType.UINT_32, unit=1) * 100
dc_power = self.tcp_client.read_holding_registers(40101, ModbusDataType.UINT_32, unit=1) * 100
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=2)
# Total eingespeiste Energie auf allen Außenleitern (Wh) [E-Total]
energy = self.tcp_client.read_holding_registers(30513, ModbusDataType.UINT_64, unit=2)
# DC-Power = power_total - Cluster-Controller gibt in Register 30775 immer korrekte Werte aus,
# 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
else:
raise FaultState.error("Unbekannte Version "+str(self.component_config.configuration.version))
if power_total == self.SMA_INT32_NAN:
Expand Down
1 change: 1 addition & 0 deletions web/settings/modulconfigpv.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
<select name="wrsmaversion" id="wrsmaversion" class="form-control">
<option <?php if($wrsmaversionold == 0) echo "selected" ?> value="0">Standard</option>
<option <?php if($wrsmaversionold == 1) echo "selected" ?> value="1">Core-2</option>
<option <?php if($wrsmaversionold == 2) echo "selected" ?> value="2">Data Manager/Cluster Controller</option>
</select>
</div>
</div>
Expand Down

0 comments on commit 01d9a4e

Please sign in to comment.