76_SolarForecast: Version 1.60.5

git-svn-id: https://svn.fhem.de/fhem/trunk@30534 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
DS_Starter
2025-11-16 16:10:27 +00:00
parent 107668395b
commit 8e0010bb38
2 changed files with 69 additions and 16 deletions

View File

@@ -162,7 +162,8 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"1.60.5" => "16.11.2025 ___csmSpecificEpieces: implement EPIECMAXOPHRS , ___batAdjustPowerByMargin: adjust pow with otpMargin ", "1.60.5" => "16.11.2025 ___csmSpecificEpieces: implement EPIECMAXOPHRS , ___batAdjustPowerByMargin: adjust pow with otpMargin ".
"__solCast_ApiResponse: evaluation of httpheader ",
"1.60.4" => "13.11.2025 smoothValue as OOP implemantation, battery efficiency rework, edit comref, expand loadTarget by time target ". "1.60.4" => "13.11.2025 smoothValue as OOP implemantation, battery efficiency rework, edit comref, expand loadTarget by time target ".
"_batSocTarget: surplus for next day adjusted, some code changes ", "_batSocTarget: surplus for next day adjusted, some code changes ",
"1.60.3" => "06.11.2025 more preparation for barrierSoC, ___batFindMinPhWh: code change, new parameter ctrlBatSocManagementXX->barrierSoC ", "1.60.3" => "06.11.2025 more preparation for barrierSoC, ___batFindMinPhWh: code change, new parameter ctrlBatSocManagementXX->barrierSoC ",
@@ -3213,6 +3214,31 @@ sub __solCast_ApiResponse {
my $hash = $defs{$name}; my $hash = $defs{$name};
my $sta = [gettimeofday]; # Start Response Verarbeitung my $sta = [gettimeofday]; # Start Response Verarbeitung
my $head = $paref->{httpheader} // 'empty header';
if ($head !~ /200.OK/ixs) { # Auswertung Header
___setSolCastAPIcallKeyData ($paref);
$data{$name}{statusapi}{SolCast}{'?All'}{response_message} = $head;
if ($head =~ /429.Too.Many.Requests/xs) {
$data{$name}{statusapi}{SolCast}{'?All'}{todayRemainingAPIrequests} = 0;
}
singleUpdateState ( {hash => $hash, state => $msg, evt => 1} );
$data{$name}{current}{runTimeLastAPIProc} = sprintf "%.4f", tv_interval($sta); # Verarbeitungszeit ermitteln
$data{$name}{current}{runTimeLastAPIAnswer} = sprintf "%.4f", (tv_interval($stc) - tv_interval($sta)); # API Laufzeit ermitteln
if ($debug =~ /apiProcess|apiCall/x) {
my $apimaxreq = AttrVal ($name, 'ctrlSolCastAPImaxReq', SOLCMAXREQDEF);
Log3 ($name, 1, "$name DEBUG> SolCast API Call - Header response content: ".$head);
Log3 ($name, 1, "$name DEBUG> SolCast API Call - todayRemainingAPIrequests: ".StatusAPIVal ($hash, 'SolCast', '?All', 'todayRemainingAPIrequests', $apimaxreq));
}
return;
}
if ($err ne "") { if ($err ne "") {
$msg = 'SolCast API server response: '.$err; $msg = 'SolCast API server response: '.$err;
@@ -12721,6 +12747,7 @@ sub ___batFindMinPhWh {
} @hods; } @hods;
$max_cap //= 0; $max_cap //= 0;
$max_cap /= $befficiency;
return { ph => (sprintf "%.0f", $max_cap), iterations => $loop, blur => (sprintf "%.4f", 0) }; return { ph => (sprintf "%.0f", $max_cap), iterations => $loop, blur => (sprintf "%.4f", 0) };
} }

View File

@@ -162,7 +162,8 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"1.60.5" => "16.11.2025 ___csmSpecificEpieces: implement EPIECMAXOPHRS , ___batAdjustPowerByMargin: adjust pow with otpMargin ", "1.60.5" => "16.11.2025 ___csmSpecificEpieces: implement EPIECMAXOPHRS , ___batAdjustPowerByMargin: adjust pow with otpMargin ".
"__solCast_ApiResponse: evaluation of httpheader ",
"1.60.4" => "13.11.2025 smoothValue as OOP implemantation, battery efficiency rework, edit comref, expand loadTarget by time target ". "1.60.4" => "13.11.2025 smoothValue as OOP implemantation, battery efficiency rework, edit comref, expand loadTarget by time target ".
"_batSocTarget: surplus for next day adjusted, some code changes ", "_batSocTarget: surplus for next day adjusted, some code changes ",
"1.60.3" => "06.11.2025 more preparation for barrierSoC, ___batFindMinPhWh: code change, new parameter ctrlBatSocManagementXX->barrierSoC ", "1.60.3" => "06.11.2025 more preparation for barrierSoC, ___batFindMinPhWh: code change, new parameter ctrlBatSocManagementXX->barrierSoC ",
@@ -3213,6 +3214,31 @@ sub __solCast_ApiResponse {
my $hash = $defs{$name}; my $hash = $defs{$name};
my $sta = [gettimeofday]; # Start Response Verarbeitung my $sta = [gettimeofday]; # Start Response Verarbeitung
my $head = $paref->{httpheader} // 'empty header';
if ($head !~ /200.OK/ixs) { # Auswertung Header
___setSolCastAPIcallKeyData ($paref);
$data{$name}{statusapi}{SolCast}{'?All'}{response_message} = $head;
if ($head =~ /429.Too.Many.Requests/xs) {
$data{$name}{statusapi}{SolCast}{'?All'}{todayRemainingAPIrequests} = 0;
}
singleUpdateState ( {hash => $hash, state => $msg, evt => 1} );
$data{$name}{current}{runTimeLastAPIProc} = sprintf "%.4f", tv_interval($sta); # Verarbeitungszeit ermitteln
$data{$name}{current}{runTimeLastAPIAnswer} = sprintf "%.4f", (tv_interval($stc) - tv_interval($sta)); # API Laufzeit ermitteln
if ($debug =~ /apiProcess|apiCall/x) {
my $apimaxreq = AttrVal ($name, 'ctrlSolCastAPImaxReq', SOLCMAXREQDEF);
Log3 ($name, 1, "$name DEBUG> SolCast API Call - Header response content: ".$head);
Log3 ($name, 1, "$name DEBUG> SolCast API Call - todayRemainingAPIrequests: ".StatusAPIVal ($hash, 'SolCast', '?All', 'todayRemainingAPIrequests', $apimaxreq));
}
return;
}
if ($err ne "") { if ($err ne "") {
$msg = 'SolCast API server response: '.$err; $msg = 'SolCast API server response: '.$err;