From cc961320381cfd32ad480477f16b9cf3d3d77ebf Mon Sep 17 00:00:00 2001 From: tpoitzsch <> Date: Fri, 23 May 2014 17:12:40 +0000 Subject: [PATCH] Neue Attribute: deltaReadings, durationReadings, minAvgMaxReadings git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5945 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_statistics.pm | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/FHEM/98_statistics.pm b/FHEM/98_statistics.pm index 181de9a75..90bf0c6de 100644 --- a/FHEM/98_statistics.pm +++ b/FHEM/98_statistics.pm @@ -361,14 +361,14 @@ statistics_DoStatistics($$$) $readingName = $$f[0]; my $completeReadingName = $devName.":".$readingName; next if ($completeReadingName =~ m/^($exclReadings)$/ ); - next if not exists ($dev->{READINGS}{$readingName}); +- next if not exists ($dev->{READINGS}{$readingName}); $statisticDone = 1; if ($$f[1] == 1) { statistics_doStatisticMinMax ($hash, $dev, $readingName, $$f[2], $periodSwitch);} if ($$f[1] == 2) { statistics_doStatisticDelta ($hash, $dev, $readingName, $$f[2], $periodSwitch);} if ($$f[1] == 3) { statistics_doStatisticDuration ($hash, $dev, $readingName, $periodSwitch);} } - my @specialReadings = split /|/, AttrVal($hashName, "deltaReadings", ""); + my @specialReadings = split /,/, AttrVal($hashName, "deltaReadings", ""); foreach $readingName (@specialReadings) { my $completeReadingName = $devName.":".$readingName; @@ -378,7 +378,7 @@ statistics_DoStatistics($$$) statistics_doStatisticDelta ($hash, $dev, $readingName, 1, $periodSwitch); } - @specialReadings = split /|/, AttrVal($hashName, "durationReadings", ""); + @specialReadings = split /,/, AttrVal($hashName, "durationReadings", ""); foreach $readingName (@specialReadings) { my $completeReadingName = $devName.":".$readingName; @@ -388,7 +388,7 @@ statistics_DoStatistics($$$) statistics_doStatisticDuration ($hash, $dev, $readingName, $periodSwitch); } - @specialReadings = split /|/, AttrVal($hashName, "minAvgMaxReadings", ""); + @specialReadings = split /,/, AttrVal($hashName, "minAvgMaxReadings", ""); foreach $readingName (@specialReadings) { my $completeReadingName = $devName.":".$readingName; @@ -890,7 +890,7 @@ statistics_FormatDuration($)
define Statistik statistics Sensor_.*|Wettersensor
<GeräteNameRegExp>
+ [Prefix]
<GeräteNameRegExp>
- deltaReadings <Gerätewerte>
+ durationReadings <Gerätewerte>
+ minAvgMaxReadings <Gerätewerte>
+ periodChangePreset <Sekunden>