diff --git a/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm b/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm index 652c8002d..b06a1a39b 100644 --- a/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm +++ b/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm @@ -122,6 +122,10 @@ BEGIN { # Versions History intern (Versions history by Heiko Maaz) my %vNotesIntern = ( + "0.2.5" => "01.04.2024 _callAnalogValue: more than 5 temperature positions (US5000) ", + "0.2.4" => "29.03.2024 avoid possible Illegal division by zero at line 1438 ", + "0.2.3" => "19.03.2024 edit commandref ", + "0.2.2" => "20.02.2024 correct commandref ", "0.2.1" => "18.02.2024 doOnError: print out faulty response, Forum:https://forum.fhem.de/index.php?msg=1303912 ", "0.2.0" => "15.12.2023 extend possible number of batteries up to 14 ", "0.1.11" => "28.10.2023 add needed data format to commandref ", @@ -1152,11 +1156,11 @@ sub _callAnalogValue { for my $z (1..$pcc) { my $fz = sprintf "%02d", $z; # formatierter Zähler - $readings->{'cellVoltage_'.$fz} = sprintf "%.3f", hex(substr($res, $bpos, 4)) / 1000; # Pos 19 - 75 bei 15 Zellen + $readings->{'cellVoltage_'.$fz} = sprintf "%.3f", hex(substr($res, $bpos, 4)) / 1000; # Pos 19 -> 75 bei 15 Zellen $bpos += 4; # letzter Durchlauf: Pos 79 bei 15 Zellen, Pos 83 bei 16 Zellen } - - $readings->{numberTempPos} = hex(substr($res, $bpos, 2)); # Anzahl der jetzt folgenden Teperaturpositionen -> 5 + + $readings->{numberTempPos} = hex(substr($res, $bpos, 2)); # Anzahl der jetzt folgenden Temperaturpositionen -> 5 oder mehr (US5000: 6) $bpos += 2; $readings->{bmsTemperature} = (hex (substr($res, $bpos, 4)) - 2731) / 10; # Pos 81 bei 15 Zellen @@ -1174,7 +1178,13 @@ sub _callAnalogValue { $readings->{'cellTemperature_13'.$pcc} = (hex (substr($res, $bpos, 4)) - 2731) / 10; # Pos 97 $bpos += 4; - my $current = hex (substr($res, $bpos, 4)); # Pos 101 + for my $t (6..$readings->{numberTempPos}) { + $t = 'add'.sprintf "%02d", $t; + $readings->{'cellTemperature_'.$t} = (hex (substr($res, $bpos, 4)) - 2731) / 10; # mehr als 5 Temperaturpositionen (z.B. US5000) + $bpos += 4; + } + + my $current = hex (substr($res, $bpos, 4)); # Pos 101 (bei 5 Temperaturpositionen) $bpos += 4; $readings->{packVolt} = sprintf "%.3f", hex (substr($res, $bpos, 4)) / 1000; # Pos 105 @@ -1432,8 +1442,8 @@ sub additionalReadings { my ($vmax, $vmin); - $readings->{averageCellVolt} = sprintf "%.3f", $readings->{packVolt} / $readings->{packCellcount} if(defined $readings->{packCellcount}); - $readings->{packSOC} = sprintf "%.2f", ($readings->{packCapacityRemain} / $readings->{packCapacity} * 100) if(defined $readings->{packCapacity}); + $readings->{averageCellVolt} = sprintf "%.3f", $readings->{packVolt} / $readings->{packCellcount} if($readings->{packCellcount}); + $readings->{packSOC} = sprintf "%.2f", ($readings->{packCapacityRemain} / $readings->{packCapacity} * 100) if($readings->{packCapacity}); $readings->{packPower} = sprintf "%.2f", $readings->{packCurrent} * $readings->{packVolt}; for (my $i=1; $i <= $readings->{packCellcount}; $i++) { @@ -1503,41 +1513,41 @@ return; =begin html - -

PylonLowVoltage

-
-Module for integration of low voltage batteries with battery management system (BMS) of the manufacturer Pylontech via -RS485/Ethernet gateway. Communication to the RS485 gateway takes place exclusively via an Ethernet connection.
-The module has been successfully used so far with Pylontech batteries of the following types:
+ +

PylonLowVoltage

+
+ Module for integration of low voltage batteries with battery management system (BMS) of the manufacturer Pylontech via + RS485/Ethernet gateway. Communication to the RS485 gateway takes place exclusively via an Ethernet connection.
+ The module has been successfully used so far with Pylontech batteries of the following types:
- + -The following devices have been successfully used as RS485 Ethernet gateways to date:
- + The following devices have been successfully used as RS485 Ethernet gateways to date:
+ -In principle, any other RS485/Ethernet gateway should also be compatible. -

+ In principle, any other RS485/Ethernet gateway should also be compatible. +

-Requirements -

-This module requires the Perl modules: - -The data format must be set on the RS485 gateway as follows: -
+ The data format must be set on the RS485 gateway as follows: +

+ + Example configuration of a Waveshare RS485 to Ethernet converter +

+ The converter's web interface offers several pages with settings. The relevant settings are shown below + as an example. The assignment of a fixed IP address is assumed in advance. +
-Limitations -
-The module currently supports a maximum of 14 batteries (master + 13 slaves) in one group. -

+ +
- -Definition - -Mode of operation - + Mode of operation + - -Get -
- - -Attributes - - - -Readings - +

=end html =begin html_DE - -

PylonLowVoltage

-
-Modul zur Einbindung von Niedervolt-Batterien mit Batteriemanagmentsystem (BMS) des Herstellers Pylontech über RS485 via -RS485/Ethernet-Gateway. Die Kommunikation zum RS485-Gateway erfolgt ausschließlich über eine Ethernet-Verbindung.
-Das Modul wurde bisher erfolgreich mit Pylontech Batterien folgender Typen eingesetzt:
+ +

PylonLowVoltage

+
+ Modul zur Einbindung von Niedervolt-Batterien mit Batteriemanagmentsystem (BMS) des Herstellers Pylontech über RS485 via + RS485/Ethernet-Gateway. Die Kommunikation zum RS485-Gateway erfolgt ausschließlich über eine Ethernet-Verbindung.
+ Das Modul wurde bisher erfolgreich mit Pylontech Batterien folgender Typen eingesetzt:
- + -Als RS485-Ethernet-Gateways wurden bisher folgende Geräte erfolgreich eingesetzt:
- + Als RS485-Ethernet-Gateways wurden bisher folgende Geräte erfolgreich eingesetzt:
+ -Prinzipiell sollte auch jedes andere RS485/Ethernet-Gateway kompatibel sein. -

+ Prinzipiell sollte auch jedes andere RS485/Ethernet-Gateway kompatibel sein. +

-Voraussetzungen -

-Dieses Modul benötigt die Perl-Module: - -Das Datenformat muß auf dem RS485 Gateway wie folgt eingestellt werden: -
+ Das Datenformat muß auf dem RS485 Gateway wie folgt eingestellt werden: +

+ + Beispielkonfiguration eines Waveshare RS485 to Ethernet Converters +

+ Das Webinterface des Konverters bietet mehrere Seiten mit Einstellungen an. Die relevanten Einstellungen sind nachfolgend + beispielhaft gezeigt. Die Zuweisung einer festen IP-Adresse wird vorab vorausgesetzt. +
-Einschränkungen -
-Das Modul unterstützt zur Zeit maximal 14 Batterien (Master + 13 Slaves) in einer Gruppe. -

+ +
- -Definition - -Arbeitsweise - + Arbeitsweise + - -Get -
- - -Attribute - - - -Readings - +

=end html_DE