mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
76_SolarForecast.pm: contrib 0.1.0
git-svn-id: https://svn.fhem.de/fhem/trunk@23427 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
80a8f5f128
commit
9e23558261
@ -187,17 +187,18 @@ sub Initialize {
|
|||||||
"headerDetail:all,co,pv,pvco,statusLink ".
|
"headerDetail:all,co,pv,pvco,statusLink ".
|
||||||
"hourCount:slider,4,1,24 ".
|
"hourCount:slider,4,1,24 ".
|
||||||
"hourStyle ".
|
"hourStyle ".
|
||||||
"maxPV ".
|
|
||||||
"htmlStart ".
|
"htmlStart ".
|
||||||
"htmlEnd ".
|
"htmlEnd ".
|
||||||
"interval ".
|
"interval ".
|
||||||
|
"layoutType:pv,co,pvco,diff ".
|
||||||
|
"maxVariancePerDay ".
|
||||||
|
"maxPV ".
|
||||||
"showDiff:no,top,bottom ".
|
"showDiff:no,top,bottom ".
|
||||||
"showHeader:1,0 ".
|
"showHeader:1,0 ".
|
||||||
"showLink:1,0 ".
|
"showLink:1,0 ".
|
||||||
"showNight:1,0 ".
|
"showNight:1,0 ".
|
||||||
"showWeather:1,0 ".
|
"showWeather:1,0 ".
|
||||||
"spaceSize ".
|
"spaceSize ".
|
||||||
"layoutType:pv,co,pvco,diff ".
|
|
||||||
"Wh/kWh:Wh,kWh ".
|
"Wh/kWh:Wh,kWh ".
|
||||||
"weatherColor:colorpicker,RGB ".
|
"weatherColor:colorpicker,RGB ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
@ -402,6 +403,8 @@ sub _setreset { ## no critic "not used"
|
|||||||
readingsDelete ($hash, "Current_PV");
|
readingsDelete ($hash, "Current_PV");
|
||||||
deleteReadingspec ($hash, ".*_PVreal" );
|
deleteReadingspec ($hash, ".*_PVreal" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createNotifyDev ($hash);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -429,7 +432,7 @@ return;
|
|||||||
################################################################
|
################################################################
|
||||||
# Setter moduleTiltAngle
|
# Setter moduleTiltAngle
|
||||||
################################################################
|
################################################################
|
||||||
sub _setmoduleTiltAngle { ## no critic "not used"
|
sub _setmoduleTiltAngle { ## no critic "not used"
|
||||||
my $paref = shift;
|
my $paref = shift;
|
||||||
my $hash = $paref->{hash};
|
my $hash = $paref->{hash};
|
||||||
my $name = $paref->{name};
|
my $name = $paref->{name};
|
||||||
@ -582,7 +585,11 @@ sub Attr {
|
|||||||
if ($aName eq "interval") {
|
if ($aName eq "interval") {
|
||||||
unless ($aVal =~ /^[0-9]+$/x) {return "The value for $aName is not valid. Use only figures 0-9 !";}
|
unless ($aVal =~ /^[0-9]+$/x) {return "The value for $aName is not valid. Use only figures 0-9 !";}
|
||||||
InternalTimer(gettimeofday()+1.0, "FHEM::SolarForecast::centralTask", $hash, 0);
|
InternalTimer(gettimeofday()+1.0, "FHEM::SolarForecast::centralTask", $hash, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($aName eq "maxVariancePerDay") {
|
||||||
|
unless ($aVal =~ /^[0-9.]+$/x) {return "The value for $aName is not valid. Use only numbers with optional decimal places !";}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1953,7 +1960,9 @@ sub calcVariance {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
readingsSingleUpdate($hash, "pvCorrectionFactor_Auto", "on", 0);
|
readingsSingleUpdate($hash, "pvCorrectionFactor_Auto", "on", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $maxvar = AttrVal($name, "maxVariancePerDay", $defmaxvar); # max. Korrekturvarianz
|
||||||
|
|
||||||
my @da;
|
my @da;
|
||||||
for my $h (1..23) {
|
for my $h (1..23) {
|
||||||
@ -1977,8 +1986,8 @@ sub calcVariance {
|
|||||||
|
|
||||||
Log3($name, 5, "$name - Hour: ".sprintf("%02d",$h).", Today PVreal: $pvval, PVforecast: $fcnum");
|
Log3($name, 5, "$name - Hour: ".sprintf("%02d",$h).", Today PVreal: $pvval, PVforecast: $fcnum");
|
||||||
|
|
||||||
if(abs($factor - $oldfac) > $defmaxvar) {
|
if(abs($factor - $oldfac) > $maxvar) {
|
||||||
$factor = sprintf "%.2f", ($factor > $oldfac ? $oldfac + $defmaxvar : $oldfac - $defmaxvar);
|
$factor = sprintf "%.2f", ($factor > $oldfac ? $oldfac + $maxvar : $oldfac - $maxvar);
|
||||||
Log3($name, 3, "$name - new limited Variance factor: $factor for hour: $h");
|
Log3($name, 3, "$name - new limited Variance factor: $factor for hour: $h");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2464,6 +2473,13 @@ Um eine Anpassung an die persönliche Anlage zu ermöglichen, können Korrekturf
|
|||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<a name="maxVariancePerDay"></a>
|
||||||
|
<li><b>maxVariancePerDay <Zahl> </b><br>
|
||||||
|
Maximale Änderungsgröße des PV Vorhersagefaktors (Reading pvCorrectionFactor_XX) pro Tag. <br>
|
||||||
|
(default: 0.5)
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
|
||||||
<a name="htmlStart"></a>
|
<a name="htmlStart"></a>
|
||||||
<li><b>htmlStart <HTML-String> </b><br>
|
<li><b>htmlStart <HTML-String> </b><br>
|
||||||
Angabe eines beliebigen HTML-Strings der vor dem Grafik-Code ausgeführt wird.
|
Angabe eines beliebigen HTML-Strings der vor dem Grafik-Code ausgeführt wird.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user