2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

76_Solarforcast: contrib 0.14.0

git-svn-id: https://svn.fhem.de/fhem/trunk@23994 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-03-18 10:31:34 +00:00
parent a019c78ba6
commit 5da24b38f2

View File

@ -326,6 +326,15 @@ my $rain_base = 0;
my @consdays = qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30); # Auswahl Anzahl Tage für Attr numHistDays
# Information zu verwendeten internen Datenhashes
# $data{$type}{$name}{pvfc} # PV forecast Ringspeicher
# $data{$type}{$name}{weather} # Weather forecast Ringspeicher
# $data{$type}{$name}{pvreal} # PV real
# $data{$type}{$name}{current} # current values
# $data{$type}{$name}{pvhist} # historische Werte pvreal, pvforecast, gridconsumtion
################################################################
# Init Fn
################################################################
@ -2945,14 +2954,14 @@ sub setPVhistory {
if($histname eq "cons") { # bezogene Energie
$val = $gthishour;
$data{$type}{$name}{pvhist}{$day}{$nhour}{cons} = $gthishour;
$data{$type}{$name}{pvhist}{$day}{$nhour}{gcons} = $gthishour;
my $gcsum = 0;
for my $k (keys %{$data{$type}{$name}{pvhist}{$day}}) {
next if($k eq "99");
$gcsum += $data{$type}{$name}{pvhist}{$day}{$k}{cons} // 0;
$gcsum += $data{$type}{$name}{pvhist}{$day}{$k}{gcons} // 0;
}
$data{$type}{$name}{pvhist}{$day}{99}{cons} = $gcsum;
$data{$type}{$name}{pvhist}{$day}{99}{gcons} = $gcsum;
}
Log3 ($name, 5, "$name - set PV History hour: $nhour, hash: $histname, val: $val");
@ -2977,9 +2986,9 @@ sub listDataPool {
my $day = shift;
my $ret;
for my $key (sort{$a<=>$b} keys %{$h->{$day}}) {
my $pvrl = $h->{$day}{$key}{pvrl} // 0;
my $pvfc = $h->{$day}{$key}{pvfc} // 0;
my $cons = $h->{$day}{$key}{cons} // 0;
my $pvrl = $h->{$day}{$key}{pvrl} // 0;
my $pvfc = $h->{$day}{$key}{pvfc} // 0;
my $cons = $h->{$day}{$key}{gcons} // 0;
$ret .= "\n " if($ret);
$ret .= $key." => pvreal: $pvrl, pvforecast: $pvfc, consumption: $cons";
}