2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

76_SolarForecast: Warning if no create AllPVforecastsToEvent events

git-svn-id: https://svn.fhem.de/fhem/trunk@29424 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-12-12 22:02:47 +00:00
parent 12b0b2511b
commit 017deda2b6
2 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it # Do not insert empty lines here, update check depends on it
- change: 76_SolarForecast: Warning if no create AllPVforecastsToEvent events
- change: 76_SolarForecast: consumerXX if mode is device/reading combination - change: 76_SolarForecast: consumerXX if mode is device/reading combination
- feature: 76_SolarForecast: consumerkey 'mode' can device/reading combination - feature: 76_SolarForecast: consumerkey 'mode' can device/reading combination
- feature: 76_SolarForecast: possible asynchron mode Battery Dev, code change - feature: 76_SolarForecast: possible asynchron mode Battery Dev, code change

View File

@ -157,6 +157,8 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"1.39.5" => "12.12.2024 __createAdditionalEvents: Warning in fhem Log if 'AllPVforecastsToEvent' events not created ".
"Notify: create cetralTask Events ",
"1.39.4" => "10.12.2024 fix Check Rooftop and Roof Ident Pair Settings (SolCast) ", "1.39.4" => "10.12.2024 fix Check Rooftop and Roof Ident Pair Settings (SolCast) ",
"1.39.3" => "09.12.2024 fix mode in consumerXX-Reading if mode is device/reading combination, show Mode in ". "1.39.3" => "09.12.2024 fix mode in consumerXX-Reading if mode is device/reading combination, show Mode in ".
"consumer legend mouse-over ", "consumer legend mouse-over ",
@ -6393,7 +6395,7 @@ sub Notify {
return; return;
} }
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state' centralTask ($myHash, 1);
return; return;
} }
} }
@ -6420,7 +6422,7 @@ sub Notify {
return; return;
} }
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state' centralTask ($myHash, 1);
return; return;
} }
} }
@ -6448,7 +6450,7 @@ sub Notify {
return; return;
} }
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state' centralTask ($myHash, 1);
return; return;
} }
} }
@ -8010,15 +8012,22 @@ sub __createAdditionalEvents {
my $type = $paref->{type}; my $type = $paref->{type};
my $hash = $defs{$name}; my $hash = $defs{$name};
my $done = 0;
for my $idx (sort keys %{$data{$type}{$name}{nexthours}}) { for my $idx (sort keys %{$data{$type}{$name}{nexthours}}) {
my $nhts = NexthoursVal ($hash, $idx, 'starttime', undef); my $nhts = NexthoursVal ($hash, $idx, 'starttime', undef);
my $nhfc = NexthoursVal ($hash, $idx, 'pvfc', undef); my $nhfc = NexthoursVal ($hash, $idx, 'pvfc', undef);
next if(!defined $nhts || !defined $nhfc); next if(!defined $nhts || !defined $nhfc);
$done = 1;
my ($dt, $h) = $nhts =~ /([\w-]+)\s(\d{2})/xs; my ($dt, $h) = $nhts =~ /([\w-]+)\s(\d{2})/xs;
storeReading ('AllPVforecastsToEvent', "$nhfc Wh", $dt." ".$h.":59:59"); storeReading ('AllPVforecastsToEvent', "$nhfc Wh", $dt." ".$h.":59:59");
} }
if (!$done) {
Log3 ($name, 2, "$name - WARNING - Events of 'AllPVforecastsToEvent' were not created due to no data in 'nexthours'");
}
return; return;
} }
@ -19721,10 +19730,10 @@ sub NexthoursVal {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
if(defined($data{$type}{$name}{nexthours}) && if (defined ($data{$type}{$name}{nexthours}) &&
defined($data{$type}{$name}{nexthours}{$nhr}) && defined ($data{$type}{$name}{nexthours}{$nhr}) &&
defined($data{$type}{$name}{nexthours}{$nhr}{$key})) { defined ($data{$type}{$name}{nexthours}{$nhr}{$key})) {
return $data{$type}{$name}{nexthours}{$nhr}{$key}; return $data{$type}{$name}{nexthours}{$nhr}{$key};
} }
return $def; return $def;