From df4db1e985725be78542caf0bc0d3dbc4563df39 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Fri, 28 May 2021 17:56:19 +0000 Subject: [PATCH] 76_SolarForecast.pm: contrib 0.48.0 git-svn-id: https://svn.fhem.de/fhem/trunk@24530 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 89 +++++++++++---------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 2fe257c59..b36273e13 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -3059,8 +3059,8 @@ sub _calcSummaries { my $batout = CurrentVal ($hash, "powerbatout", 0); # aktuelle Batterieentladung my $consumption = int ($pvgen - $gfeedin + $gcon - $batin + $batout); - my $selfconsumption = int ($pvgen - $gfeedin); - my $surplus = int ($pvgen-$consumption); # aktueller Überschuß + my $selfconsumption = int ($pvgen - $gfeedin - $batin); + my $surplus = int ($pvgen - $consumption); # aktueller Überschuß my $selfconsumptionrate = 0; my $autarkyrate = 0; $selfconsumptionrate = sprintf("%.0f", $selfconsumption / $pvgen * 100) if($pvgen); @@ -4218,7 +4218,7 @@ sub flowGraphic { my $cgfi_style = $cgfi ? $active : $inactive; 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_color = $csc ? 'yellow' : 'gray'; @@ -4245,8 +4245,8 @@ sub flowGraphic { my $ret = qq{ -
- +
+ @@ -4283,50 +4283,53 @@ sub flowGraphic { - }; + }; - if ($hasbat) { - $ret .= qq{ - - - - }; - - $ret .= '' if ($soc > 24); - $ret .= '' if ($soc > 49); - $ret .= '' if ($soc > 74); - $ret .= '' if ($soc > 90); - $ret .= ''; - } - - $ret .= qq{ - - - $csc - - - $cgfi - - $cgc + + + + }; + + $ret .= '' if ($soc > 24); + $ret .= '' if ($soc > 49); + $ret .= '' if ($soc > 74); + $ret .= '' if ($soc > 90); + $ret .= ''; + } + + $ret .= qq{ + + + + }; + + $ret .= qq{$csc} if ($csc); + $ret .= qq{$cpv} if ($cpv); + $ret .= qq{" transform="translate(-120,620) rotate(-90)"' : 'start;">'; + + $ret .= $cgfi if ($cgfi); + + $ret .= qq{}; + $ret .= qq{$cgc} if ($cgc); + + + if ($hasbat) { + $ret .= qq{ + + + $soc % }; - $ret .= qq{ - - $batout + $ret .= qq{$batout} if ($batout); + $ret .= qq{$batin} if ($batin); + } - - $batin - $soc % - } if ($hasbat); - - $ret .= qq{
}; + $ret .= qq{
}; return $ret; }