2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

76_SolarForecast.pm: contrib 0.48.0

git-svn-id: https://svn.fhem.de/fhem/trunk@24530 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-05-28 17:56:19 +00:00
parent 454124eefc
commit df4db1e985

View File

@ -3059,8 +3059,8 @@ sub _calcSummaries {
my $batout = CurrentVal ($hash, "powerbatout", 0); # aktuelle Batterieentladung my $batout = CurrentVal ($hash, "powerbatout", 0); # aktuelle Batterieentladung
my $consumption = int ($pvgen - $gfeedin + $gcon - $batin + $batout); my $consumption = int ($pvgen - $gfeedin + $gcon - $batin + $batout);
my $selfconsumption = int ($pvgen - $gfeedin); my $selfconsumption = int ($pvgen - $gfeedin - $batin);
my $surplus = int ($pvgen-$consumption); # aktueller Überschuß my $surplus = int ($pvgen - $consumption); # aktueller Überschuß
my $selfconsumptionrate = 0; my $selfconsumptionrate = 0;
my $autarkyrate = 0; my $autarkyrate = 0;
$selfconsumptionrate = sprintf("%.0f", $selfconsumption / $pvgen * 100) if($pvgen); $selfconsumptionrate = sprintf("%.0f", $selfconsumption / $pvgen * 100) if($pvgen);
@ -4218,7 +4218,7 @@ sub flowGraphic {
my $cgfi_style = $cgfi ? $active : $inactive; my $cgfi_style = $cgfi ? $active : $inactive;
my $cgfi_color = $cgfi ? 'yellow' : 'gray'; my $cgfi_color = $cgfi ? 'yellow' : 'gray';
my $csc = ReadingsNum($name, 'Current_Consumption', 0); my $csc = ReadingsNum($name, 'Current_SelfConsumption', 0);
my $csc_style = $csc ? $active : $inactive; my $csc_style = $csc ? $active : $inactive;
my $csc_color = $csc ? 'yellow' : 'gray'; my $csc_color = $csc ? 'yellow' : 'gray';
@ -4245,8 +4245,8 @@ sub flowGraphic {
my $ret = qq{ my $ret = qq{
<table class="roomoverview"> <table class="roomoverview">
<tr><td><table class="block"><tr align="center"><td> <tr><td><table class="block"><tr align="center" class="odd"><td>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" style="$style"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="5 15 380 380" style="$style">
<style>$animation</style> <style>$animation</style>
<g transform="translate(200,50)"> <g transform="translate(200,50)">
<g> <g>
@ -4303,28 +4303,31 @@ sub flowGraphic {
$ret .= qq{ $ret .= qq{
<g transform="translate(50,50),scale(0.5)" stroke-width="27" fill="none"> <g transform="translate(50,50),scale(0.5)" stroke-width="27" fill="none">
<path id="pv-home" style="$csc_style" d="M270,100 L270,180 C270,270,270,270,180,270 L100,270" stroke="$csc_color" /> <path id="pv-home" style="$csc_style" d="M270,100 L270,180 C270,270,270,270,180,270 L100,270" stroke="$csc_color" />
<text id="pv-home-txt" x="210" y="240" style="fill: #ccc; font-size: $fs; text-anchor: end;">$csc</text>
<path id="pv-grid" style="$cgfi_style" d="M300,100 L300,500" stroke="$cgfi_color" /> <path id="pv-grid" style="$cgfi_style" d="M300,100 L300,500" stroke="$cgfi_color" />
<text id="pv-grid-txt" x="330" y="490" style="fill: #ccc; font-size: $fs; text-anchor: '
}; };
$ret .= (!$hasbat) ? 'middle;" transform="translate(-120,620) rotate(-90)"' : 'start;"'; $ret .= qq{<text id="pv-home-txt" x="210" y="240" style="fill: #ccc; font-size: $fs; text-anchor: end;">$csc</text>} if ($csc);
$ret .= qq{<text id="pv-home-txt" x="400" y="15" style="fill: #ccc; font-size: $fs; text-anchor: start;">$cpv</text>} if ($cpv);
$ret .= qq{<text id="pv-grid-txt" x="330" y="490" style="fill: #ccc; font-size: $fs; text-anchor: '}; #"
$ret .= qq{ $ret .= (!$hasbat) ? 'middle;>" transform="translate(-120,620) rotate(-90)"' : 'start;">';
>$cgfi</text>
<path id="grid-home" style="$cgc_style" d="M270,500 L270,420 C270,330,270,330,180,330 L100,330" stroke="$cgc_color" />
<text id="grid-home-txt" x="210" y="390" style="fill: #ccc; font-size: $fs; text-anchor: end;">$cgc</text>
};
$ret .= $cgfi if ($cgfi);
$ret .= qq{</text><path id="grid-home" style="$cgc_style" d="M270,500 L270,420 C270,330,270,330,180,330 L100,330" stroke="$cgc_color" />};
$ret .= qq{<text id="grid-home-txt" x="210" y="390" style="fill: #ccc; font-size: $fs; text-anchor: end;">$cgc</text>} if ($cgc);
if ($hasbat) {
$ret .= qq{ $ret .= qq{
<path id="bat-home" style="$batout_style" d="M500,300 L100,300" stroke="$batout_color" /> <path id="bat-home" style="$batout_style" d="M500,300 L100,300" stroke="$batout_color" />
<text id="bat-home-txt" x="390" y="351" style="fill: #ccc; font-size: $fs; text-anchor: start;">$batout</text>
<path id="pv-bat" style="$batin_style" d="M330,100 L330,180 C330,270,330,270,420,270 L500,270" stroke="$batin_color" /> <path id="pv-bat" style="$batin_style" d="M330,100 L330,180 C330,270,330,270,420,270 L500,270" stroke="$batin_color" />
<text id="pv-bat-txt" x="390" y="245" style="fill: #ccc; font-size: $fs; text-anchor: start;">$batin</text>
<text x="0" y="500" style="fill: #ccc; font-size: $fs; text-anchor: middle;" transform="translate(150,300) rotate(-90)">$soc %</text> <text x="0" y="500" style="fill: #ccc; font-size: $fs; text-anchor: middle;" transform="translate(150,300) rotate(-90)">$soc %</text>
} if ($hasbat); };
$ret .= qq{<text id="bat-home-txt" x="390" y="351" style="fill: #ccc; font-size: $fs; text-anchor: start;">$batout</text>} if ($batout);
$ret .= qq{<text id="pv-bat-txt" x="390" y="245" style="fill: #ccc; font-size: $fs; text-anchor: start;">$batin</text>} if ($batin);
}
$ret .= qq{</g></svg></td></tr></table></td></tr></table>}; $ret .= qq{</g></svg></td></tr></table></td></tr></table>};