From 32ffc259e0e7673cd09d9e4b0c27410c5416ae2c Mon Sep 17 00:00:00 2001 From: grompo Date: Mon, 25 Apr 2016 17:07:12 +0000 Subject: [PATCH] statistics: attr durationPeriodHour 1 | 0 git-svn-id: https://svn.fhem.de/fhem/trunk@11309 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_statistics.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fhem/FHEM/98_statistics.pm b/fhem/FHEM/98_statistics.pm index ddd274255..52bb65fc5 100644 --- a/fhem/FHEM/98_statistics.pm +++ b/fhem/FHEM/98_statistics.pm @@ -131,6 +131,7 @@ sub statistics_Initialize($) ."dayChangeTime " ."deltaReadings " ."durationReadings " + ."durationPeriodHour:0,1 " ."excludedReadings " ."ignoreDefaultAssignments:0,1 " ."minAvgMaxReadings " @@ -928,6 +929,10 @@ sub statistics_doStatisticDuration ($$$$) $state = "(null)" if $state eq ""; statistics_Log $hash, 4, "Calculating duration statistics for '".$dev->{NAME}.":$readingName = $state'"; + + # Daily Statistic + statistics_doStatisticDurationSingle $hash, $dev, $readingName, "Hour", $state, ($periodSwitch !=0) + if AttrVal($name, "durationPeriodHour", 0) == 1; # Daily Statistic statistics_doStatisticDurationSingle $hash, $dev, $readingName, "Day", $state, ($periodSwitch >= 2 || $periodSwitch <= -2); # Monthly Statistic @@ -1223,6 +1228,10 @@ sub statistics_UpdateDevReading($$$$)
Comma separated list of reading names for which a delta statistic shall be calculated.
+
  • durationPeriodHour < 1 | 0 > +
    + If set to 1, then duration readings will get hourly statistics too. +

  • durationReadings <readings>
    Comma separated list of reading names for which a duration statistic shall be calculated. @@ -1387,6 +1396,10 @@ sub statistics_UpdateDevReading($$$$)
    Durch Kommas getrennte Liste von weiteren Gerätewerten, für welche die Differenz zwischen den Werten am Anfang und Ende einer Periode (Stunde/Tag/Monat/Jahr) bestimmt wird.

  • +
  • durationPeriodHour < 1 | 0 > +
    + Wenn auf 1 gesetzt, dann werden für "durationReadings" auch stündliche Statistiken gebildet. +

  • durationReadings <Gerätewerte>
    Durch Kommas getrennte Liste von weiteren Gerätewerten, für welche die Dauer einzelner Gerätewerte innerhalb bestimmte Zeiträume (Stunde/Tag/Monat/Jahr) erfasst wird.