2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

76_SolarForecast.pm: contrib 0.37.0

git-svn-id: https://svn.fhem.de/fhem/trunk@24264 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-04-17 07:52:06 +00:00
parent eca257bfc1
commit 0f6919014f

View File

@ -1008,6 +1008,7 @@ sub _setreset { ## no critic "not used"
delete $hash->{HELPER}{INITCONTOTAL};
delete $hash->{HELPER}{INITFEEDTOTAL};
delete $data{$type}{$name}{current}{gridconsumption};
delete $data{$type}{$name}{current}{tomorrowconsumption};
delete $data{$type}{$name}{current}{gridfeedin};
delete $data{$type}{$name}{current}{consumption};
}
@ -2277,7 +2278,7 @@ sub _calcSummaries {
limitArray ($data{$type}{$name}{current}{h4fcslidereg}, $defslidenum);
my $gcon = CurrentVal ($hash, "gridconsumption", 0); # aktueller Netzbezug
my $tconsum = CurrentVal ($hash, "tomorrowconsumption", 0); # Verbrauchsprognose für morgigen Tag
my $tconsum = CurrentVal ($hash, "tomorrowconsumption", undef); # Verbrauchsprognose für folgenden Tag
my $pvgen = CurrentVal ($hash, "generation", 0);
my $gfeedin = CurrentVal ($hash, "gridfeedin", 0);
my $batin = CurrentVal ($hash, "powerbatin", 0); # aktuelle Batterieladung
@ -2287,7 +2288,7 @@ sub _calcSummaries {
$data{$type}{$name}{current}{consumption} = $consumption;
push @$daref, "Current_Consumption<>". $consumption. " W";
push @$daref, "Tomorrow_ConsumptionForecast<>".$tconsum. " Wh";
push @$daref, "Tomorrow_ConsumptionForecast<>".$tconsum. " Wh" if(defined $tconsum);
push @$daref, "NextHours_Sum01_PVforecast<>". (int $next1HoursSum->{PV})." Wh";
push @$daref, "NextHours_Sum02_PVforecast<>". (int $next2HoursSum->{PV})." Wh";
push @$daref, "NextHours_Sum03_PVforecast<>". (int $next3HoursSum->{PV})." Wh";
@ -2353,6 +2354,11 @@ sub estConsumptionForecast {
my $chour = $paref->{chour};
my $t = $paref->{t};
my $medev = ReadingsVal($name, "currentMeterDev", ""); # aktuelles Meter device
my ($a,$h) = parseParams ($medev);
$medev = $a->[0] // "";
return if(!$medev || !$defs{$medev});
my $type = $hash->{TYPE};
## Verbrauchsvorhersage für den nächsten Tag