From f2613a388ff3a5a8ac68bec921a15a62c842bd9c Mon Sep 17 00:00:00 2001 From: grompo <> Date: Tue, 6 Sep 2016 19:45:43 +0000 Subject: [PATCH] statistics: added reading luminosity git-svn-id: https://svn.fhem.de/fhem/trunk@12128 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_statistics.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_statistics.pm b/fhem/FHEM/98_statistics.pm index 52bb65fc5..9539a199d 100644 --- a/fhem/FHEM/98_statistics.pm +++ b/fhem/FHEM/98_statistics.pm @@ -72,6 +72,7 @@ sub statistics_UpdateDevReading($$$$); ,"humidity" => 1 ,"lightsensor" => 3 ,"lock" => 3 + ,"luminosity" => 1 ,"motion" => 3 ,"power" => 1 ,"pressure" => 4 @@ -189,7 +190,8 @@ sub statistics_Set($$@) my $resultStr = ""; if ($cmd eq 'resetStatistics') { - if ($val ne "") { + if ($val ne "") { + Log3 $name, 3, "statistics: set $name $cmd $val"; my $regExp; if ($val eq "all") { $regExp = ""; } else { $regExp = $val.":.*"; } @@ -210,6 +212,7 @@ sub statistics_Set($$@) return $resultStr; } elsif ($cmd eq 'doStatistics') { + Log3 $name, 3, "statistics: set $name $cmd"; statistics_DoStatisticsAll($hash,0); return undef; } @@ -542,7 +545,8 @@ sub statistics_doStatisticMinMaxSingle ($$$$$$) $hidden[1] = 0; $hidden[3] = 0; $hidden[9] = 1; $stat[1] = $value; $stat[3] = $value; $stat[5] = $value; $stat[7] = strftime ("%Y-%m-%d_%H:%M:%S",localtime() ); - } else { + } + else { # Do calculations if hidden reading exists @hidden = split / /, $hash->{READINGS}{$hiddenReadingName}{VAL}; # Internal values @stat = split / /, $dev->{READINGS}{$statReadingName}{VAL}; @@ -1141,6 +1145,10 @@ sub statistics_UpdateDevReading($$$$) =pod =begin html +=item helper +=item summary Calculates for statistical values and adds them to the devices. +=item summary_DE Berechnet statistische Werte und fügt sie dem Gerät hinzu. +