76_SolarForecast: contrib 1.46.2

git-svn-id: https://svn.fhem.de/fhem/trunk@29677 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
DS_Starter
2025-02-19 17:26:36 +00:00
parent dcd126478c
commit 7670c08b72

View File

@@ -159,7 +159,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.46.2" => "19.02.2025 aiAddRawData: save original data and sort to bin in sub aiAddInstancePV ",
"1.46.2" => "19.02.2025 aiAddRawData: save original data and sort to bin in sub aiAddInstancePV instead, _calcConsForecast_circular: include epiecAVG ",
"1.46.1" => "18.02.2025 improve temp2bin, correct Log output to consumptionHistory, set setupStringDeclination can be free integer between 0..90 ",
"1.46.0" => "17.02.2025 Notification System: print out last/next file pull if no messages are present, improvements and activation of ".
"_calcConsForecast_circular, checkPlantConfig: add Data Memory check pvHistory 'con' ".
@@ -12026,7 +12026,7 @@ sub _calcConsForecast_circular {
## Verbrauch der hod-Stunden 01..24 u. gesamten Tag ermitteln
###############################################################
for my $h (1..24) { # Median für jede Stunde / Tag berechnen
my $dt = timestringsFromOffset ($st, $h * 3559); # eine Sek. weniger als 1 Stunde
$dt = timestringsFromOffset ($st, $h * 3559); # eine Sek. weniger als 1 Stunde
my $dayname = $dt->{dayname};
my $hh = sprintf "%02d", $h;
@@ -12116,6 +12116,8 @@ sub _calcConsForecast_circular {
## hist. On-Stunden aller Tage aufnehmen
##########################################
my $epiecelem = 1;
for my $h (1..24) { # excludieren ob exconfc 1 oder 2
my $hh = sprintf "%02d", $h;
$csme = HistoryVal ($hash, $n, $hh, "csme${c}", 0);
@@ -12125,10 +12127,20 @@ sub _calcConsForecast_circular {
$usage{$hh}{histnum}++;
}
if ($exconfc == 2 && $lap == 1) { # Planungsdaten des Consumers inkludieren
if (defined $data{$name}{consumers}{$c}{epiecAVG}{1}) {
$usage{$hh}{plancon} += $data{$name}{consumers}{$c}{epiecAVG}{1};
if ($exconfc == 2 && $lap == 1) { # AVG-Daten des Consumers inkludieren
my $rt = $st + (3600 * ($h - 1)); # Schleifenlaufzeit
my $plson = ConsumerVal ($name, $c, 'planswitchon', $st + 86400); # geplante Switch-on Zeit des Consumers
my $plsoff = ConsumerVal ($name, $c, 'planswitchoff', 0); # geplante Switch-off Zeit des Consumers
if ($rt >= $plson && $rt <= $plsoff) {
if (defined $data{$name}{consumers}{$c}{epiecAVG}{$epiecelem}) {
$usage{$hh}{plancon} += $data{$name}{consumers}{$c}{epiecAVG}{$epiecelem};
$usage{$hh}{plannum}++;
debugLog ($paref, 'consumption_long', "consumer '$c' register epiecAVG: ".$data{$name}{consumers}{$c}{epiecAVG}{$epiecelem}." Wh for include in Hour $hh");
$epiecelem++;
}
}
}
}
@@ -17410,15 +17422,11 @@ sub aiAddRawData {
my $rr1c = HistoryVal ($hash, $pvd, $hod, 'rr1c', undef);
my $rad1h = HistoryVal ($hash, $pvd, $hod, 'rad1h', undef);
#my $tbin = temp2bin ($temp) if(defined $temp);
#my $cbin = cloud2bin ($wcc) if(defined $wcc);
#my $sabin = sunalt2bin ($sunalt);
$data{$name}{aidectree}{airaw}{$ridx}{sunalt} = $sunalt;
$data{$name}{aidectree}{airaw}{$ridx}{sunaz} = $sunaz;
$data{$name}{aidectree}{airaw}{$ridx}{dayname} = $dayname;
$data{$name}{aidectree}{airaw}{$ridx}{hod} = $hod;
$data{$name}{aidectree}{airaw}{$ridx}{temp} = $temp if(defined $temp);
$data{$name}{aidectree}{airaw}{$ridx}{temp} = sprintf "%.0f", $temp if(defined $temp);
$data{$name}{aidectree}{airaw}{$ridx}{con} = $con if(defined $con && $con >= 0);
$data{$name}{aidectree}{airaw}{$ridx}{wcc} = $wcc if(defined $wcc);
$data{$name}{aidectree}{airaw}{$ridx}{rr1c} = $rr1c if(defined $rr1c);
@@ -21817,6 +21825,8 @@ return $def;
# ehodpieces - geplante Energiescheiben nach Tagesstunde (hour of day) (Hash)
# dswoncond - Device zur Lieferung einer zusätzliche Einschaltbedingung
# planstate - Planungsstatus
# planswitchon - geplante Switch-On Zeit
# planswitchoff - geplante Switch-Off Zeit
# planSupplement - Ergänzung zum Planungsstatus
# rswoncond - Reading zur Lieferung einer zusätzliche Einschaltbedingung
# swoncondregex - Regex einer zusätzliche Einschaltbedingung