2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 00:36:25 +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.
# 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
- feature: 76_SolarForecast: consumerkey 'mode' can device/reading combination
- feature: 76_SolarForecast: possible asynchron mode Battery Dev, code change

View File

@ -157,6 +157,8 @@ BEGIN {
# Versions History intern
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.3" => "09.12.2024 fix mode in consumerXX-Reading if mode is device/reading combination, show Mode in ".
"consumer legend mouse-over ",
@ -6393,7 +6395,7 @@ sub Notify {
return;
}
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state'
centralTask ($myHash, 1);
return;
}
}
@ -6420,7 +6422,7 @@ sub Notify {
return;
}
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state'
centralTask ($myHash, 1);
return;
}
}
@ -6448,7 +6450,7 @@ sub Notify {
return;
}
centralTask ($myHash, 0); # keine Events in SolarForecast außer 'state'
centralTask ($myHash, 1);
return;
}
}
@ -8009,16 +8011,23 @@ sub __createAdditionalEvents {
my $name = $paref->{name};
my $type = $paref->{type};
my $hash = $defs{$name};
my $done = 0;
for my $idx (sort keys %{$data{$type}{$name}{nexthours}}) {
my $nhts = NexthoursVal ($hash, $idx, 'starttime', undef);
my $nhfc = NexthoursVal ($hash, $idx, 'pvfc', undef);
next if(!defined $nhts || !defined $nhfc);
$done = 1;
my ($dt, $h) = $nhts =~ /([\w-]+)\s(\d{2})/xs;
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;
}
@ -19721,10 +19730,10 @@ sub NexthoursVal {
my $name = $hash->{NAME};
my $type = $hash->{TYPE};
if(defined($data{$type}{$name}{nexthours}) &&
defined($data{$type}{$name}{nexthours}{$nhr}) &&
defined($data{$type}{$name}{nexthours}{$nhr}{$key})) {
return $data{$type}{$name}{nexthours}{$nhr}{$key};
if (defined ($data{$type}{$name}{nexthours}) &&
defined ($data{$type}{$name}{nexthours}{$nhr}) &&
defined ($data{$type}{$name}{nexthours}{$nhr}{$key})) {
return $data{$type}{$name}{nexthours}{$nhr}{$key};
}
return $def;