diff --git a/fhem/CHANGED b/fhem/CHANGED
index f987dac99..aef91f2cc 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it
+ - bugfix: 76_SolarForecast: minor fix in Flowgraphic
- bufgix: 72_FRITZBOX: Perl Warning behoben
- feature: 76_SolarForecast: see Forum: ..index.php?msg=1323142
- bufgix: 72_FRITZBOX: reconnect Fehler nach offline Device
diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm
index b1205267d..082a42282 100644
--- a/fhem/FHEM/76_SolarForecast.pm
+++ b/fhem/FHEM/76_SolarForecast.pm
@@ -156,6 +156,9 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
+ "1.37.1" => "23.10.2024 state: 'The setup routine is still incomplete' if setup is incomplete ".
+ "change: 'trackFlex' && \$wcc >= 80 to \$wcc >= 70, implement Rename function ".
+ "_flowGraphic: eliminate numbers in device name - Forum: https://forum.fhem.de/index.php?msg=1323229 ",
"1.37.0" => "22.10.2024 attr setupInverterDevXX up to 03 inverters with accorded strings, setupInverterDevXX: keys strings and feed ".
"_flowGraphic: controlhash for producer, new attr flowGraphicControl and replace the attributes: ".
"flowGraphicAnimate flowGraphicConsumerDistance flowGraphicShowConsumer flowGraphicShowConsumerDummy ".
@@ -330,55 +333,6 @@ my %vNotesIntern = (
"1.1.1" => "19.11.2023 graphicHeaderOwnspec: fix ignoring the last element of allsets/allattr ",
"1.1.0" => "14.11.2023 graphicHeaderOwnspec: possible add set/attr commands, new setter consumerNewPlanning ",
"1.0.10" => "31.10.2023 fix warnings, edit comref ",
- "1.0.9" => "29.10.2023 _aiGetSpread: set spread from 50 to 20 ",
- "1.0.8" => "22.10.2023 codechange: add central readings store array, new function storeReading, writeCacheToFile ".
- "solcastapi in sub __delObsoleteAPIData, save freespace if flowGraphicShowConsumer=0 is set ".
- "pay attention to attr graphicEnergyUnit in __createOwnSpec ",
- "1.0.7" => "21.10.2023 more design options for graphicHeaderOwnspec and a possible line title ",
- "1.0.6" => "19.10.2023 new attr ctrlGenPVdeviation ",
- "1.0.5" => "11.10.2023 new sub _aiGetSpread for estimate AI results stepwise, allow key 'noshow' values 0,1,2,3 ".
- "calculate conForecastTillNextSunrise accurate to the minute ",
- "1.0.4" => "10.10.2023 fix: print always Log in _calcCaQ* subroutines even if calaculated factors are equal ".
- "new consumer attr key 'noshow' ",
- "1.0.3" => "08.10.2023 change graphic header PV/CO detail, new attr graphicHeaderOwnspec, internal code changes ".
- "fix isAddSwitchOffCond 0 Forum: https://forum.fhem.de/index.php?msg=1288877 ".
- "change _calcValueImproves and subroutines ",
- "1.0.2" => "05.10.2023 replace calcRange by cloud2bin ",
- "1.0.1" => "03.10.2023 fixes in comRef, bug fix Forum: https://forum.fhem.de/index.php?msg=1288637 ",
- "1.0.0" => "01.10.2023 preparation for check in ",
- "0.83.3" => "28.09.2023 fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1288032 ".
- "delete AllPVforecastsToEvent after event generation ",
- "0.83.2" => "26.09.2023 setter reset consumption ",
- "0.83.1" => "26.09.2023 change currentRadiationDev to currentRadiationAPI, new attr ctrlAIdataStorageDuration ".
- "new elements todayConsumptionForecast, conForecastTillNextSunrise for attr ctrlStatisticReadings ".
- "add entry text in guided procedure ",
- "0.83.0" => "19.09.2023 add manageTrain for AI Training in parallel process ",
- "0.82.4" => "16.09.2023 generate DWD API graphics header information and extend plant check for DWD API errors, minor fixes ",
- "0.82.3" => "14.09.2023 more mouse over information in graphic header, ai support in autocorrection selectable ".
- "substitute use of Test2::Suite ",
- "0.82.2" => "11.09.2023 activate implementation of DWD AI support, add runTimeTrainAI ",
- "0.82.1" => "08.09.2023 rebuild implementation of DWD AI support, some error fixing (FHEM restarts between 0 and 1) ",
- "0.82.0" => "02.09.2023 first implementation of DWD AI support, new ctrlDebug aiProcess aiData, reset aiData ",
- "0.81.1" => "30.08.2023 show forecast qualities when pressing quality icon in forecast grafic, store rad1h (model DWD) in ".
- "pvhistory, removed: affectCloudfactorDamping, affectRainfactorDamping ",
- "0.81.0" => "27.08.2023 development version for Victron VRM API, __PvFcSimpleDnumHist changed, available setter ".
- "are now API specific, switch currentForecastDev to currentWeatherDev ".
- "affectCloudfactorDamping default 0, affectRainfactorDamping default 0 ".
- "call consumption forecast from Victron VRM API ",
- "0.80.20"=> "15.08.2023 hange calculation in ___setSolCastAPIcallKeyData once again, fix some warnings ",
- "0.80.19"=> "10.08.2023 fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1283836 ",
- "0.80.18"=> "07.08.2023 change calculation of todayDoneAPIcalls in ___setSolCastAPIcallKeyData, add \$lagtime ".
- "Forum: https://forum.fhem.de/index.php?msg=1283487 ",
- "0.80.17"=> "05.08.2023 change sequence of _createSummaries in centralTask, ComRef edited ",
- "0.80.16"=> "26.07.2023 new consumer type noSchedule, expand maxconsumer to 16, minor changes/fixes ",
- "0.80.15"=> "24.07.2023 new sub getDebug, new key switchdev in consumer attributes, change Debug consumtion ".
- "reorg data in pvHistory when a hour of day was deleted ",
- "0.80.14"=> "21.07.2023 __substituteIcon: use isConsumerLogOn instead of isConsumerPhysOn ",
- "0.80.13"=> "18.07.2023 include parameter DoN in nextHours hash, new KPI's todayConForecastTillSunset, currentRunMtsConsumer_XX ".
- "minor fixes and improvements ",
- "0.80.12"=> "16.07.2023 preparation for alternative switch device in consumer attribute, revise CommandRef ".
- "fix/improve sub ___readCandQ and much more, get pvHistory -> one specific day selectable ".
- "get valConsumerMaster -> one specific consumer selectable, enhance consumer key locktime by on-locktime ",
"0.1.0" => "09.12.2020 initial Version "
);
@@ -680,6 +634,19 @@ my %hmoon = (
7 => { icon => 'weather_moon_phases_8', DE => 'abnehmende Sichel', EN => 'decreasing crescent' },
);
+ my %hrepl = ( # Zeichenersetzungen
+ 0 => 'a',
+ 1 => 'b',
+ 2 => 'c',
+ 3 => 'd',
+ 4 => 'e',
+ 5 => 'f',
+ 6 => 'g',
+ 7 => 'h',
+ 8 => 'i',
+ 9 => 'j',
+ );
+
my %hqtxt = ( # Hash (Setup) Texte
entry => { EN => qq{Warm welcome!
The next queries will guide you through the basic installation.
@@ -1225,6 +1192,7 @@ sub Initialize {
$hash->{FW_summaryFn} = \&FwFn;
$hash->{FW_detailFn} = \&FwFn;
$hash->{ShutdownFn} = \&Shutdown;
+ $hash->{RenameFn} = \&Rename;
$hash->{DbLog_splitFn} = \&DbLogSplit;
$hash->{AttrFn} = \&Attr;
$hash->{NotifyFn} = \&Notify;
@@ -3460,7 +3428,7 @@ sub __getDWDSolarData {
my ($af, $pv, $sdr, $wcc);
- if ($cafd =~ /track/xs) { # Flächenfaktor Sonnenstand geführt
+ if ($cafd =~ /track/xs) { # Flächenfaktor Sonnenstand geführt
($af, $sdr, $wcc) = ___areaFactorTrack ( { name => $name,
day => $day,
dday => $dday,
@@ -3480,7 +3448,7 @@ sub __getDWDSolarData {
$af = 1.00 if(!isNumeric($af));
$sdr = 0.75 if(!isNumeric($sdr));
- if ($cafd eq 'trackShared'|| ($cafd eq 'trackFlex' && $wcc >= 80)) { # Direktstrahlung + Diffusstrahlung
+ if ($cafd eq 'trackShared'|| ($cafd eq 'trackFlex' && $wcc >= 70)) { # Direktstrahlung + Diffusstrahlung
my $dirrad = $rad * $sdr; # Anteil Direktstrahlung an Globalstrahlung
my $difrad = $rad - $dirrad; # Anteil Diffusstrahlung an Globalstrahlung
@@ -6352,6 +6320,24 @@ sub DbLogSplit {
return ($reading, $value, $unit);
}
+################################################################
+# Rename
+################################################################
+sub Rename {
+ my $new_name = shift;
+ my $old_name = shift;
+
+ my $hash = $defs{$old_name};
+ my $type = (split '::', __PACKAGE__)[1];
+
+ $data{$type}{$new_name} = $data{$type}{$old_name};
+ delete $data{$type}{$old_name};
+
+ # Log3 ($new_name, 1, qq{$new_name - Dump -> \n}. Dumper $data{$type}{$new_name});
+
+return;
+}
+
################################################################
# Shutdown
################################################################
@@ -6408,7 +6394,8 @@ sub Delete {
$csmcache.$name,
$scpicache.$name,
$airaw.$name,
- $aitrained.$name
+ $aitrained.$name,
+ $pvhexprtcsv.$name
);
opendir (DIR, $cachedir);
@@ -6428,6 +6415,9 @@ sub Delete {
if ($err) {
Log3 ($name, 1, qq{$name - Message while deleting file "$f": $err});
}
+ else {
+ Log3 ($name, 3, qq{$name - INFO - File "$f" successfully deleted.});
+ }
}
my $type = $hash->{TYPE};
@@ -6958,8 +6948,12 @@ sub centralTask {
if (!CurrentVal ($hash, 'allStringsFullfilled', 0)) { # die String Konfiguration erstellen wenn noch nicht erfolgreich ausgeführt
my $ret = createStringConfig ($hash);
- if ($ret) {
- singleUpdateState ( {hash => $hash, state => $ret, evt => 1} ); # Central Task running Statusbit
+ if ($ret) {
+ if (!CurrentVal ($hash, 'setupcomplete', 0)) {
+ $ret = 'The setup routine is still incomplete';
+ }
+ singleUpdateState ( {hash => $hash, state => $ret, evt => 1} ); # Central Task running Statusbit
+
return;
}
}
@@ -12017,7 +12011,7 @@ sub FwFn {
# Autorefresh nur des aufrufenden FHEMWEB-Devices
my $al = AttrVal ($name, 'ctrlAutoRefresh', 0);
- if($al) {
+ if ($al) {
pageRefresh ($hash);
}
@@ -12034,7 +12028,7 @@ sub pageRefresh {
my $al = AttrVal($name, 'ctrlAutoRefresh', 0);
- if($al) {
+ if ($al) {
my $rftime = gettimeofday()+$al;
if (!$hash->{HELPER}{AREFRESH} || $hash->{HELPER}{AREFRESH} <= gettimeofday()) {
@@ -12428,9 +12422,13 @@ sub _checkSetupNotComplete {
$ret .= "";
$ret .= "";
$ret =~ s/LINK/$link/gxs;
+
+ delete $data{$type}{$name}{current}{setupcomplete};
return $ret;
}
+
+ $data{$type}{$name}{current}{setupcomplete} = 1;
return;
}
@@ -14232,6 +14230,9 @@ sub _flowGraphic {
my $hasbat = 1; # initial Batterie vorhanden
my $lcp;
+ my $stna = $name;
+ $stna =~ s/([0-9])/$hrepl{$1}/ge if($name =~ /[0-9]/xs); # V 1.37.1 Ziffern eliminieren, Forum: https://forum.fhem.de/index.php?msg=1323229
+
## definierte Producer + Inverter ermitteln und zusammenfassen
################################################################
my $pdcr = {}; # Hashref Producer
@@ -14302,9 +14303,9 @@ sub _flowGraphic {
## Batterie + Werte festlegen
###############################
- my $bat_color = $soc < 26 ? "$name bat25" :
- $soc < 76 ? "$name bat50" :
- "$name bat75";
+ my $bat_color = $soc < 26 ? "$stna bat25" :
+ $soc < 76 ? "$stna bat50" :
+ "$stna bat75";
if (!defined $batin && !defined $bat2home) {
$hasbat = 0;
@@ -14313,15 +14314,15 @@ sub _flowGraphic {
$soc = 0;
}
- my $grid2home_style = $cgc ? "$name active_sig" : "$name inactive"; # cgc current GridConsumption
- my $bat2home_style = $bat2home ? "$name active_normal" : "$name inactive";
+ my $grid2home_style = $cgc ? "$stna active_sig" : "$stna inactive"; # cgc current GridConsumption
+ my $bat2home_style = $bat2home ? "$stna active_normal" : "$stna inactive";
my $cgc_direction = "M490,515 L670,590";
if ($bat2home) { # Batterie wird ins Haus entladen
my $cgfo = $node2grid - $pv2node;
if ($cgfo > 1) {
- $grid2home_style = "$name active_normal";
+ $grid2home_style = "$stna active_normal";
$cgc_direction = "M670,590 L490,515";
$node2grid -= $cgfo;
$cgc = $cgfo;
@@ -14336,7 +14337,7 @@ sub _flowGraphic {
if ($home2bat > 1) { # Batterieladung wird anteilig aus Hausnetz geladen
$node2bat -= $home2bat;
- $bat2home_style = "$name active_sig";
+ $bat2home_style = "$stna active_sig";
$bat2home_direction = "M730,590 L902,515";
$bat2home = $home2bat;
}
@@ -14367,34 +14368,34 @@ sub _flowGraphic {
my $svgstyle = 'width:98%; height:'.$flowgsize.'px;';
my $animation = $flowgani ? '@keyframes dash { to { stroke-dashoffset: 0; } }' : ''; # Animation Ja/Nein
- my $grid_color = $node2grid ? "$name grid_green" :
- !$node2grid && !$cgc && $bat2home ? "$name grid_gray" :
- "$name grid_red";
+ my $grid_color = $node2grid ? "$stna grid_green" :
+ !$node2grid && !$cgc && $bat2home ? "$stna grid_gray" :
+ "$stna grid_red";
my $strokecolstd = CurrentVal ($hash, 'strokecolstd', $strokcolstddef);
my $strokecolsig = CurrentVal ($hash, 'strokecolsig', $strokcolsigdef);
my $strokecolina = CurrentVal ($hash, 'strokecolina', $strokcolinadef);
my $strokewidth = CurrentVal ($hash, 'strokewidth', $strokwidthdef);
-
+
my $ret = << "END0";
-