2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 03:44:52 +00:00

76_SolarForecast: contrib 1.46.2

git-svn-id: https://svn.fhem.de/fhem/trunk@29674 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2025-02-19 11:36:28 +00:00
parent 004761d44f
commit c2bb6f117d

View File

@ -159,6 +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.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' ".
@ -12019,6 +12020,9 @@ sub _calcConsForecast_circular {
my (@cona, $exconfc, $csme, %usage);
$usage{tom}{con} = 0;
debugLog ($paref, 'consumption|consumption_long', "################### Start Consumption forecast ###################");
debugLog ($paref, 'consumption_long', "Basics - installed locale: ".LOCALE_TIME.", used scheme: $lct");
## Verbrauch der hod-Stunden 01..24 u. gesamten Tag ermitteln
###############################################################
for my $h (1..24) { # Median für jede Stunde / Tag berechnen
@ -12026,6 +12030,8 @@ sub _calcConsForecast_circular {
my $dayname = $dt->{dayname};
my $hh = sprintf "%02d", $h;
debugLog ($paref, 'consumption_long', "process Today dayname: $dayname, Tomorrow dayname: $tomdayname") if($h == 1);
my (@conh, @conhtom);
my $mix = 0;
@ -17053,9 +17059,13 @@ sub aiAddInstancePV { ## no critic "not used"
my $rr1c = AiRawdataVal ($hash, $idx, 'rr1c', undef);
my $sunalt = AiRawdataVal ($hash, $idx, 'sunalt', 0);
my $tbin = temp2bin ($temp) if(defined $temp);
my $cbin = cloud2bin ($wcc) if(defined $wcc);
my $sabin = sunalt2bin ($sunalt);
eval { $dtree->add_instance (attributes => { rad1h => $rad1h,
temp => $temp,
wcc => $wcc,
temp => $tbin,
wcc => $cbin,
rr1c => $rr1c,
sunalt => $sunalt,
hod => $hod
@ -17402,17 +17412,17 @@ 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);
#my $tbin = temp2bin ($temp) if(defined $temp);
#my $cbin = cloud2bin ($wcc) if(defined $wcc);
#my $sabin = sunalt2bin ($sunalt);
$data{$name}{aidectree}{airaw}{$ridx}{sunalt} = $sabin;
$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} = $tbin if(defined $tbin);
$data{$name}{aidectree}{airaw}{$ridx}{temp} = $temp if(defined $temp);
$data{$name}{aidectree}{airaw}{$ridx}{con} = $con if(defined $con && $con >= 0);
$data{$name}{aidectree}{airaw}{$ridx}{wcc} = $cbin if(defined $cbin);
$data{$name}{aidectree}{airaw}{$ridx}{wcc} = $wcc if(defined $wcc);
$data{$name}{aidectree}{airaw}{$ridx}{rr1c} = $rr1c if(defined $rr1c);
$data{$name}{aidectree}{airaw}{$ridx}{rad1h} = $rad1h if(defined $rad1h && $rad1h > 0);
@ -17428,7 +17438,7 @@ sub aiAddRawData {
my $pvrl = HistoryVal ($hash, $pvd, $hod, 'pvrl', undef);
$data{$name}{aidectree}{airaw}{$ridx}{pvrl} = $pvrl if(defined $pvrl && $pvrl > 0);
debugLog ($paref, 'aiProcess', "AI raw add - idx: $ridx, day: $pvd, hod: $hod, sunalt: $sabin, sunaz: $sunaz, rad1h: ".(defined $rad1h ? $rad1h : '-').", pvrl: ".(defined $pvrl ? $pvrl : '-').", con: ".(defined $con ? $con : '-').", wcc: ".(defined $cbin ? $cbin : '-').", rr1c: ".(defined $rr1c ? $rr1c : '-').", temp: ".(defined $tbin ? $tbin : '-'), 4);
debugLog ($paref, 'aiProcess', "AI raw add - idx: $ridx, day: $pvd, hod: $hod, sunalt: $sunalt, sunaz: $sunaz, rad1h: ".(defined $rad1h ? $rad1h : '-').", pvrl: ".(defined $pvrl ? $pvrl : '-').", con: ".(defined $con ? $con : '-').", wcc: ".(defined $wcc ? $wcc : '-').", rr1c: ".(defined $rr1c ? $rr1c : '-').", temp: ".(defined $temp ? $temp : '-'), 4);
}
}