diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm
index 9db69b0fd..9e65d47d1 100644
--- a/fhem/contrib/DS_Starter/76_SolarForecast.pm
+++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm
@@ -153,7 +153,7 @@ my @chours = (5..21); # St
my $defpvme = 16.52; # default Wirkungsgrad Solarmodule
my $definve = 98.3; # default Wirkungsgrad Wechselrichter
my $kJtokWh = 0.00027778; # Umrechnungsfaktor kJ in kWh
-my $maxvariance = 0.3; # max. Varianz pro Durchlauf Berechnung Autokorrekturfaktor
+my $maxvariance = 0.6; # max. Varianz pro Durchlauf Berechnung Autokorrekturfaktor
my $definterval = 70; # Standard Abfrageintervall
################################################################
@@ -747,10 +747,7 @@ sub _transferInverterValues {
$indev = $a->[0] // "";
return if(!$indev || !$defs{$indev});
- my $tlim = "0|23"; # Stunde 0/23 -> bestimmte Aktionen
-
- my $sr = (split ":", ReadingsVal($name, "Today_SunRise", "00:00"))[0];
- my $ss = (split ":", ReadingsVal($name, "Today_SunSet", "00:00"))[0];
+ my $tlim = "0|23"; # Stunde 0/23 -> bestimmte Aktionen
if($chour =~ /^($tlim)$/x) {
deleteReadingspec ($hash, "Today_Hour.*_PV.*");
@@ -772,18 +769,23 @@ sub _transferInverterValues {
my $etoday = ReadingsNum ($indev, $edread, 0) * $eduf; # aktuelle Erzeugung (W)
my $edaypast = 0;
+ deleteReadingspec ($hash, "Today_Hour00_PVreal");
for my $h (0..int($chour)-1) { # alle bisherigen Erzeugungen des Tages summieren
- if($h <= int($sr)-3) {
- readingsSingleUpdate($hash, "Today_Hour".sprintf("%02d",$h)."_PVreal", "0 Wh", 0);
- next;
- }
$edaypast += ReadingsNum ($name, "Today_Hour".sprintf("%02d",$h)."_PVreal", 0);
}
my $ethishour = $etoday - $edaypast;
- push @$daref, "Today_Hour${chour}_PVreal:". $ethishour." Wh" if($chour !~ /^($tlim)$/x); # nicht setzen wenn Stunde 23 des Tages
-
+ #if($ethishour < 0) { # fehlerhaft berechnete etoday eliminieren
+ # push @$daref, "Today_Hour".sprintf("%02d",$chour-1)."_PVreal:0 Wh";
+ # push @$daref, "Today_Hour".sprintf("%02d",$chour)."_PVreal:0 Wh";
+ if($chour <= 3 && $ethishour > 0) {
+ push @$daref, "Today_Hour".sprintf("%02d",$chour)."_PVreal:0 Wh";
+ }
+ else {
+ push @$daref, "Today_Hour".sprintf("%02d",$chour)."_PVreal:". $ethishour." Wh" if($chour !~ /^($tlim)$/x); # nicht setzen wenn Stunde 23 des Tages
+ }
+
return;
}
@@ -1097,6 +1099,8 @@ sub forecastGraphic {
my $pvRe = ReadingsNum ($name,"RestOfDay_PV", 0);
my $pvTo = ReadingsNum ($name,"Tomorrow_PV", 0);
my $pvCu = ReadingsNum ($name,"Current_PV", 0);
+
+ my $pcfa = ReadingsVal ($name,"pvCorrectionFactor_Auto", "off");
if ($kw eq 'kWh') {
$co4h = sprintf("%.1f" , $co4h/1000)." kWh";
@@ -1129,14 +1133,16 @@ sub forecastGraphic {
my $dlink = "$alias";
my $lup = ReadingsTimestamp($name, "ThisHour_PVforecast", "0000-00-00 00:00:00"); # letzter Forecast Update
- my $lupt = "last update:";
+ my $lupt = "last update:";
+ my $autoct = "automatic correction:";
my $lblPv4h = "next 4h:";
my $lblPvRe = "remain today:";
my $lblPvTo = "tomorrow:";
my $lblPvCu = "actual";
if(AttrVal("global", "language", "EN") eq "DE") { # Header globales Sprachschema Deutsch
- $lupt = "Stand:";
+ $lupt = "Stand:";
+ $autoct = "automatische Korrektur:";
$lblPv4h = encode("utf8", "nächste 4h:");
$lblPvRe = "Rest heute:";
$lblPvTo = "morgen:";
@@ -1164,8 +1170,10 @@ sub forecastGraphic {
}
my $upstate = ReadingsVal($name, "state", "");
- my $upicon;
+ ## Update-Icon
+ ##############
+ my $upicon;
if ($upstate =~ /updated/ix) {
$upicon = "";
}
@@ -1178,8 +1186,29 @@ sub forecastGraphic {
else {
$upicon = "
";
}
+
+ ## Autokorrektur-Icon
+ ######################
+ my $acicon;
+ if ($pcfa eq "on") {
+ $acicon = "
";
+ }
+ elsif ($pcfa eq "off") {
+ $acicon = "off";
+ }
+ elsif ($pcfa =~ /standby/ix) {
+ my ($rtime) = $pcfa =~ /for (.*?) hours/x;
+ $acicon = "
(Start in ".$rtime." h)";
+ }
+ else {
+ $acicon = "
";
+ }
+
- $header .= "