2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 01:46:08 +00:00

76_SolarForecast.pm: contrib 0.21.0

git-svn-id: https://svn.fhem.de/fhem/trunk@24075 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-03-24 15:54:18 +00:00
parent 0c5ceefdb6
commit a0370ef8c0

View File

@ -1351,7 +1351,7 @@ sub _additionalEvents {
my $mseclog = AttrVal("global", "mseclog", 0); my $mseclog = AttrVal("global", "mseclog", 0);
my $tsmsec = $mseclog ? ".000" : q{}; my $tsmsec = $mseclog ? ".000" : q{};
my ($ts,$pvfc,$pvrl); my ($ts,$pvfc,$pvrl,$gcon);
$ts = $date." ".sprintf("%02d",$chour).":00:00".$tsmsec; $ts = $date." ".sprintf("%02d",$chour).":00:00".$tsmsec;
@ -1361,17 +1361,23 @@ sub _additionalEvents {
$pvrl = ReadingsNum($name, "Today_Hour".sprintf("%02d",$chour)."_PVreal", undef); $pvrl = ReadingsNum($name, "Today_Hour".sprintf("%02d",$chour)."_PVreal", undef);
__addCHANGED ($hash, "PVreal: ".$pvrl, $ts) if(defined $pvrl); __addCHANGED ($hash, "PVreal: ".$pvrl, $ts) if(defined $pvrl);
$gcon = ReadingsNum($name, "Today_Hour".sprintf("%02d",$chour)."_GridConsumption", undef);
__addCHANGED ($hash, "Gridconsumption: ".$gcon, $ts) if(defined $gcon);
my $tlim = "00"; # bestimmte Aktionen my $tlim = "00"; # bestimmte Aktionen
if($chour =~ /^($tlim)$/x) { if($chour =~ /^($tlim)$/x) {
if(!exists $hash->{HELPER}{H00DONE}) { if(!exists $hash->{HELPER}{H00DONE}) {
$ts = $date." ".sprintf("%02d",24).":00:00".$tsmsec; $ts = $date." 24:00:00".$tsmsec;
$pvfc = ReadingsNum($name, "Today_Hour".sprintf("%02d",24)."_PVforecast", undef); $pvfc = ReadingsNum($name, "Today_Hour24_PVforecast", undef);
__addCHANGED ($hash, "PVforecast: ".$pvfc, $ts) if(defined $pvfc); __addCHANGED ($hash, "PVforecast: ".$pvfc, $ts) if(defined $pvfc);
$pvrl = ReadingsNum($name, "Today_Hour".sprintf("%02d",24)."_PVreal", undef); $pvrl = ReadingsNum($name, "Today_Hour24_PVreal", undef);
__addCHANGED ($hash, "PVreal: ".$pvrl, $ts) if(defined $pvrl); __addCHANGED ($hash, "PVreal: ".$pvrl, $ts) if(defined $pvrl);
$gcon = ReadingsNum($name, "Today_Hour24_GridConsumption", undef);
__addCHANGED ($hash, "Gridconsumption: ".$gcon, $ts) if(defined $gcon);
deleteReadingspec ($hash, "Today_Hour.*_GridConsumption"); deleteReadingspec ($hash, "Today_Hour.*_GridConsumption");
deleteReadingspec ($hash, "Today_Hour.*_PV.*"); deleteReadingspec ($hash, "Today_Hour.*_PV.*");
delete $hash->{HELPER}{INITETOTAL}; delete $hash->{HELPER}{INITETOTAL};