diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 35b459617..7eee704e3 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -120,6 +120,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "0.56.1" => "12.09.2021 some fixes ", "0.56.0" => "11.09.2021 new Attr flowGraphicShowConsumer, extend calc consumer power consumption ", "0.55.3" => "08.09.2021 add powerthreshold to etotal key ", "0.55.2" => "08.09.2021 minor fixes, use Color ", @@ -2705,7 +2706,7 @@ sub _manageConsumerData { $data{$type}{$name}{consumers}{$c}{currpowerpercent} = $currpowerpercent; if($pcurr > $pthreshold || $currpowerpercent > $defpopercent) { - if($data{$type}{$name}{consumers}{$c}{onoff} ne "on") { + if(ConsumerVal ($hash, $c, "onoff", "off") eq "off") { $data{$type}{$name}{consumers}{$c}{startTime} = $t; $data{$type}{$name}{consumers}{$c}{onoff} = "on"; my $stimes = ConsumerVal ($hash, $c, "numberDayStarts", 0); # Anzahl der On-Schaltungen am Tag @@ -2720,12 +2721,16 @@ sub _manageConsumerData { $data{$type}{$name}{consumers}{$c}{minutesOn} = ConsumerVal ($hash, $c, "lastMinutesOn", 0) + $runtime; } else { # neue Stunde hat begonnen - $data{$type}{$name}{consumers}{$c}{startTime} = timestringToTimestamp ($date." ".sprintf("%02d",$chour).":00:00"); - $data{$type}{$name}{consumers}{$c}{lastMinutesOn} = ($t - ConsumerVal ($hash, $c, "startTime", $t)) / 60; # in Minuten ! (gettimeofday sind ms !) + if(ConsumerVal ($hash, $c, "onoff", "off") eq "on") { + $data{$type}{$name}{consumers}{$c}{startTime} = timestringToTimestamp ($date." ".sprintf("%02d",$chour).":00:00"); + $data{$type}{$name}{consumers}{$c}{minutesOn} = ($t - ConsumerVal ($hash, $c, "startTime", $t)) / 60; # in Minuten ! (gettimeofday sind ms !) + $data{$type}{$name}{consumers}{$c}{lastMinutesOn} = 0; + } } } else { $data{$type}{$name}{consumers}{$c}{onoff} = "off"; + delete $data{$type}{$name}{consumers}{$c}{startTime}; } ## Durchschnittsverbrauch / Betriebszeit ermitteln + speichern @@ -7408,9 +7413,9 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen