diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm
index 587e75f0f..86ea1dd95 100644
--- a/fhem/contrib/DS_Starter/76_SolarForecast.pm
+++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm
@@ -158,6 +158,8 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
+ "1.17.12"=> "06.05.2024 attr ctrlInterval: immediate impact when set ",
+ "1.17.11"=> "04.05.2024 correction in commandref, delete attr affectMaxDayVariance ",
"1.17.10"=> "19.04.2024 calcTodayPVdeviation: avoid Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1311121 ",
"1.17.9" => "17.04.2024 _batSocTarget: fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1310930 ",
"1.17.8" => "16.04.2024 calcTodayPVdeviation: change of calculation ",
@@ -1094,7 +1096,6 @@ sub Initialize {
"affectBatteryPreferredCharge:slider,0,1,100 ".
"affectConsForecastIdentWeekdays:1,0 ".
"affectConsForecastInPlanning:1,0 ".
- "affectMaxDayVariance:obsolete ".
"affectSolCastPercentile:select,10,50,90 ".
"consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ".
"consumerAdviceIcon ".
@@ -5304,14 +5305,14 @@ sub Attr {
### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !!
######################################################################################################################
- if ($cmd eq 'set' && $aName eq 'affectMaxDayVariance') {
- if (!$init_done) {
- return qq{Device "$name" -> The attribute '$aName' is obsolete and will be deleted soon. Please press "save config" when restart is finished.};
- }
- else {
- return qq{The attribute '$aName' is obsolete and will be deleted soon.};
- }
- }
+ #if ($cmd eq 'set' && $aName eq 'affectMaxDayVariance') {
+ # if (!$init_done) {
+ # return qq{Device "$name" -> The attribute '$aName' is obsolete and will be deleted soon. Please press "save config" when restart is finished.};
+ # }
+ # else {
+ # return qq{The attribute '$aName' is obsolete and will be deleted soon.};
+ # }
+ #}
######################################################################################################################
if ($aName eq 'disable') {
@@ -5379,16 +5380,23 @@ sub Attr {
}
}
- if ($init_done == 1 && $aName eq "ctrlSolCastAPIoptimizeReq") {
+ if ($init_done && $aName eq 'ctrlSolCastAPIoptimizeReq') {
if (!isSolCastUsed ($hash)) {
return qq{The attribute $aName is only valid for device model "SolCastAPI".};
}
}
- if ($aName eq 'ctrlUserExitFn' && $init_done) {
+ if ($init_done && $aName eq 'ctrlUserExitFn') {
($err) = checkCode ($name, $aVal, 'cc1');
return $err if($err);
}
+
+ if ($init_done && $aName eq 'ctrlInterval') {
+ _newCycTime ($hash, time, $aVal);
+ my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime
+ readingsSingleUpdate ($hash, 'nextCycletime', (!$nct ? 'Manual' : FmtTime($nct)), 0);
+ return;
+ }
}
my $params = {
@@ -6149,12 +6157,7 @@ sub runTask {
my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime
if ($t >= $nct) {
- my $new = $t + $interval; # nächste Wiederholungszeit
- $hash->{MODE} = 'Automatic - next Cycletime: '.FmtTime($new);
-
- $data{$hash->{TYPE}}{$name}{current}{nextCycleTime} = $new;
-
- storeReading ('nextCycletime', FmtTime($new));
+ _newCycTime ($hash, $t, $interval);
centralTask ($hash, 1);
}
@@ -6193,6 +6196,30 @@ sub runTask {
return;
}
+################################################################
+# neue Zykluszeit bestimmen
+################################################################
+sub _newCycTime {
+ my $hash = shift;
+ my $t = shift;
+ my $interval = shift;
+
+ if (!$interval) {
+ $hash->{MODE} = 'Manual';
+ $data{$hash->{TYPE}}{$hash->{NAME}}{current}{nextCycleTime} = 0;
+ storeReading ('nextCycletime', 'Manual');
+ return;
+ }
+
+ my $new = $t + $interval; # nächste Wiederholungszeit
+ $hash->{MODE} = 'Automatic - next Cycletime: '.FmtTime($new);
+
+ $data{$hash->{TYPE}}{$hash->{NAME}}{current}{nextCycleTime} = $new;
+ storeReading ('nextCycletime', FmtTime($new));
+
+return;
+}
+
################################################################
# neue Attribute zur Laufzeit hinzufügen
# Device spezifische ".AttrList" überschreibt Modul AttrList !
@@ -6257,32 +6284,8 @@ sub centralTask {
### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !!
##########################################################################################################################
- my $nscc = ReadingsVal ($name, 'nextSolCastCall', ''); # 14.03.2024
- if ($nscc) {
- readingsSingleUpdate ($hash, 'nextRadiationAPICall', $nscc, 0);
- deleteReadingspec ($hash, 'nextSolCastCall');
- }
- if (keys %{$data{$type}{$name}{aidectree}{airaw}}) { # 27.03.2024
- for my $idx (sort keys %{$data{$type}{$name}{aidectree}{airaw}}) {
- my $val = AiRawdataVal ($hash, $idx, 'rad1h', undef);
-
- if (!defined $val) {
- delete $data{$type}{$name}{aidectree}{airaw}{$idx};
- $val = 'aaaaaaaaaa';
- }
-
- if ($val =~ /\.[0-9]{1}$/xs) {
- delete $data{$type}{$name}{aidectree}{airaw}{$idx};
- }
-
- if ($val =~ /\.00$/xs) {
- my $renv = int $val;
- $data{$type}{$name}{aidectree}{airaw}{$idx}{rad1h} = $renv;
- }
- }
- }
- #######################################################################################################################
+ ##########################################################################################################################
setModel ($hash); # Model setzen
@@ -14077,14 +14080,6 @@ sub aiAddRawData {
my $rad1h = HistoryVal ($hash, $pvd, $hod, 'rad1h', undef);
next if(!$rad1h || $rad1h <= 0);
-
- ### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !!
- #######################################################################################################################
- next if($rad1h =~ /\.[0-9]{1}$/xs); # 29.03.2024 -> einen Monat drin lassen wegen pvHistory turn
- if ($rad1h =~ /\.00$/xs) { # 29.03.2024 -> einen Monat drin lassen wegen pvHistory turn
- $rad1h = int $rad1h;
- }
- #######################################################################################################################
my $pvrl = HistoryVal ($hash, $pvd, $hod, 'pvrl', undef);
next if(!$pvrl || $pvrl <= 0);
@@ -17905,8 +17900,8 @@ to ensure that the system configuration is correct.
Example:
set <name> currentInverterDev STP5000 pv=total_pac:kW etotal=etotal:kWh capacity=5000
- # Device STP5000 provides PV values. The current generated power in the reading "total_pac" (kW) and the daily generation in the reading "etotal" (kWh).
- The maximum power of the inverter is 5000 Watt.
+ # Device STP5000 provides PV values. The currently generated power in the "total_pac" reading (kW) and the total energy
+ generated in the reading "etotal" (kWh). The maximum output of the inverter is 5000 watts.
@@ -20134,7 +20129,7 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
Beispiel:
set <name> currentInverterDev STP5000 pv=total_pac:kW etotal=etotal:kWh capacity=5000
- # Device STP5000 liefert PV-Werte. Die aktuell erzeugte Leistung im Reading "total_pac" (kW) und die tägliche Erzeugung im
+ # Device STP5000 liefert PV-Werte. Die aktuell erzeugte Leistung im Reading "total_pac" (kW) und die erzeugte Gesamtenergie im
Reading "etotal" (kWh). Die max. Leistung des Wechselrichters beträgt 5000 Watt.