mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
76_SolarForecast: contrib 1.0.7
git-svn-id: https://svn.fhem.de/fhem/trunk@28077 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
abdfd2fdcc
commit
17be09785e
@ -144,6 +144,7 @@ BEGIN {
|
||||
|
||||
# Versions History intern
|
||||
my %vNotesIntern = (
|
||||
"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 ",
|
||||
@ -7758,15 +7759,6 @@ sub _calcTodayPVdeviation {
|
||||
|
||||
my $pvfc = ReadingsNum ($name, 'Today_PVforecast', 0);
|
||||
my $pvre = ReadingsNum ($name, 'Today_PVreal', 0);
|
||||
|
||||
#my $hsr = (split ":", ReadingsVal ($name, 'Today_SunRise', '03:00'))[0]; # die Stunde des Sonnenaufgangs
|
||||
#my $ehsr = HistoryVal ($hash, $day, $hsr, 'etotal', 0); # gespeichertes etotal vor Sonnenaufgang
|
||||
|
||||
#if ($ehsr) {
|
||||
# my $esset = CurrentVal ($hash, 'etotal', 0); # Erzeugung total (Wh) nach Sonnenuntergang
|
||||
# $pvre = $esset - $ehsr;
|
||||
# $pvre = 0 if($pvre <= 0);
|
||||
#}
|
||||
|
||||
return if(!$pvre);
|
||||
|
||||
@ -7788,7 +7780,6 @@ sub _calcTodayPVdeviation {
|
||||
$data{$type}{$name}{circular}{99}{tdayDvtn} = $dp;
|
||||
|
||||
push @$daref, "Today_PVdeviation<>". $dp.' %';
|
||||
#push @$daref, "Today_PVreal<>". $pvre.' Wh';
|
||||
|
||||
return;
|
||||
}
|
||||
@ -9094,9 +9085,21 @@ sub __createOwnSpec {
|
||||
|
||||
return if(!$spec || !$show);
|
||||
|
||||
my @fields = split (/\s+/sx, $spec);
|
||||
|
||||
my (@cats, @vals);
|
||||
|
||||
for my $f (@fields) {
|
||||
if ($f =~ /^\#(.*)/xs) {
|
||||
push @cats, $1;
|
||||
next;
|
||||
}
|
||||
|
||||
push @vals, $f;
|
||||
}
|
||||
|
||||
my $ownv;
|
||||
my @vals = split (/\s+/sx, $spec);
|
||||
my $rows = ceil (scalar(@vals) / $vinr);
|
||||
my $rows = ceil (scalar(@vals) / $vinr);
|
||||
my $col = 0;
|
||||
|
||||
for (my $i = 1 ; $i <= $rows; $i++) {
|
||||
@ -9108,11 +9111,11 @@ sub __createOwnSpec {
|
||||
}
|
||||
|
||||
$ownv .= "<tr>";
|
||||
$ownv .= "<td $dstyle></td>";
|
||||
$ownv .= "<td $dstyle><b>".$h->{0}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{0}{rdg},'')."</td>" if(exists $h->{0}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{1}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{1}{rdg},'')."</td>" if(exists $h->{1}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{2}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{2}{rdg},'')."</td>" if(exists $h->{2}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{3}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{3}{rdg},'')."</td>" if(exists $h->{3}{label});
|
||||
$ownv .= "<td $dstyle>".($cats[$i-1] ? '<b>'.$cats[$i-1].'</b>' : '')."</td>";
|
||||
$ownv .= "<td $dstyle><b>".$h->{0}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{0}{rdg},'')."</td>" if($h->{0}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{1}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{1}{rdg},'')."</td>" if($h->{1}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{2}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{2}{rdg},'')."</td>" if($h->{2}{label});
|
||||
$ownv .= "<td $dstyle><b>".$h->{3}{label}.":</b></td> <td align=right $dstyle>".ReadingsVal ($name,$h->{3}{rdg},'')."</td>" if($h->{3}{label});
|
||||
$ownv .= "</tr>";
|
||||
}
|
||||
|
||||
@ -15921,23 +15924,34 @@ to ensure that the system configuration is correct.
|
||||
|
||||
<a id="SolarForecast-attr-graphicHeaderOwnspec"></a>
|
||||
<li><b>graphicHeaderOwnspec <Label>:<Reading> <Label>:<Reading> ... </b><br>
|
||||
Display of any reading values of the device. The values to be displayed are separated by spaces.
|
||||
Each value is to be defined by a label and the corresponding reading connected by ":".
|
||||
The input can be multiline. Spaces in the label are to be inserted by "&nbsp;", a line break
|
||||
by "<br>".
|
||||
Display of any reading values of the device. <br>
|
||||
The values to be displayed are separated by spaces.
|
||||
Four values (fields) are displayed per line. <br>
|
||||
The input can be made in multiple lines. <br><br>
|
||||
|
||||
Each value is to be defined by a label and the corresponding reading connected by ":". <br>
|
||||
Spaces in the label are to be inserted by "&nbsp;", a line break by "<br>". <br>
|
||||
An empty field in a line is created by ":". <br>
|
||||
A line title can be inserted by specifying "#:<Text>", an empty title by entering "#".
|
||||
<br><br>
|
||||
|
||||
<ul>
|
||||
<b>Example: </b> <br>
|
||||
<table>
|
||||
<colgroup> <col width="30%"> <col width="70%"> </colgroup>
|
||||
<tr><td> attr <name> graphicHeaderOwnspec </td><td>AutarkyRate:Current_AutarkyRate </td></tr>
|
||||
<tr><td> </td><td>Surplus:Current_Surplus </td></tr>
|
||||
<tr><td> </td><td>current&nbsp;Gridconsumption:Current_GridConsumption </td></tr>
|
||||
<tr><td> </td><td>CO&nbsp;until&nbsp;sunset:statistic_todayConForecastTillSunset </td></tr>
|
||||
<tr><td> </td><td>PV&nbsp;the&nbsp;day&nbsp;after&nbsp;tomorrow:statistic_dayAfterTomorrowPVforecast </td></tr>
|
||||
<tr><td> </td><td>BAT&nbsp;in&nbsp;today:statistic_todayBatIn </td></tr>
|
||||
<tr><td> </td><td>BAT&nbsp;out&nbsp;today:statistic_todayBatOut </td></tr>
|
||||
<colgroup> <col width="33%"> <col width="67%"> </colgroup>
|
||||
<tr><td> attr <name> graphicHeaderOwnspec </td><td># </td></tr>
|
||||
<tr><td> </td><td>AutarkyRate:Current_AutarkyRate </td></tr>
|
||||
<tr><td> </td><td>Surplus:Current_Surplus </td></tr>
|
||||
<tr><td> </td><td>current&nbsp;Gridconsumption:Current_GridConsumption </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td># </td></tr>
|
||||
<tr><td> </td><td>CO&nbsp;until&nbsp;sunset:statistic_todayConForecastTillSunset </td></tr>
|
||||
<tr><td> </td><td>PV&nbsp;Day&nbsp;after&nbsp;tomorrow:statistic_dayAfterTomorrowPVforecast </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td>#Battery </td></tr>
|
||||
<tr><td> </td><td>in&nbsp;today:statistic_todayBatIn </td></tr>
|
||||
<tr><td> </td><td>out&nbsp;today:statistic_todayBatOut </td></tr>
|
||||
</table>
|
||||
</ul>
|
||||
</li>
|
||||
@ -17748,23 +17762,34 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
|
||||
|
||||
<a id="SolarForecast-attr-graphicHeaderOwnspec"></a>
|
||||
<li><b>graphicHeaderOwnspec <Label>:<Reading> <Label>:<Reading> ... </b><br>
|
||||
Anzeige beliebiger Readingswerte des Devices. Die anzuzeigenden Werte werden durch Leerzeichen getrennt.
|
||||
Jeder Wert ist jeweils durch ein Label und das dazugehörige Reading verbunden durch ":" zu definieren.
|
||||
Die Eingabe kann mehrzeilig erfolgen. Leerzeichen im Label sind durch "&nbsp;" einzufügen, ein Zeilenumbruch
|
||||
durch "<br>".
|
||||
Anzeige beliebiger Readingswerte des Devices. <br>
|
||||
Die anzuzeigenden Werte werden durch Leerzeichen getrennt.
|
||||
Es werden vier Werte (Felder) pro Zeile dargestellt. <br>
|
||||
Die Eingabe kann mehrzeilig erfolgen. <br><br>
|
||||
|
||||
Jeder Wert ist jeweils durch ein Label und das dazugehörige Reading verbunden durch ":" zu definieren. <br>
|
||||
Leerzeichen im Label sind durch "&nbsp;" einzufügen, ein Zeilenumbruch durch "<br>". <br>
|
||||
Ein leeres Feld in einer Zeile wird durch ":" erzeugt. <br>
|
||||
Ein Zeilentitel kann durch Angabe von "#:<Text>" eingefügt werden, ein leerer Titel durch die Eingabe von "#".
|
||||
<br><br>
|
||||
|
||||
<ul>
|
||||
<b>Beispiel: </b> <br>
|
||||
<table>
|
||||
<colgroup> <col width="35%"> <col width="65%"> </colgroup>
|
||||
<tr><td> attr <name> graphicHeaderOwnspec </td><td>AutarkyRate:Current_AutarkyRate </td></tr>
|
||||
<tr><td> attr <name> graphicHeaderOwnspec </td><td># </td></tr>
|
||||
<tr><td> </td><td>AutarkyRate:Current_AutarkyRate </td></tr>
|
||||
<tr><td> </td><td>Überschuß:Current_Surplus </td></tr>
|
||||
<tr><td> </td><td>aktueller&nbsp;Netzbezug:Current_GridConsumption </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td># </td></tr>
|
||||
<tr><td> </td><td>CO&nbsp;bis&nbsp;Sonnenuntergang:statistic_todayConForecastTillSunset </td></tr>
|
||||
<tr><td> </td><td>PV&nbsp;Übermorgen:statistic_dayAfterTomorrowPVforecast </td></tr>
|
||||
<tr><td> </td><td>BAT&nbsp;in&nbsp;heute:statistic_todayBatIn </td></tr>
|
||||
<tr><td> </td><td>BAT&nbsp;out&nbsp;heute:statistic_todayBatOut </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td>: </td></tr>
|
||||
<tr><td> </td><td>#Batterie </td></tr>
|
||||
<tr><td> </td><td>in&nbsp;heute:statistic_todayBatIn </td></tr>
|
||||
<tr><td> </td><td>out&nbsp;heute:statistic_todayBatOut </td></tr>
|
||||
</table>
|
||||
</ul>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user