mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
Neue Attribute: deltaReadings, durationReadings, minAvgMaxReadings
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5945 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2960361037
commit
cc96132038
@ -361,14 +361,14 @@ statistics_DoStatistics($$$)
|
|||||||
$readingName = $$f[0];
|
$readingName = $$f[0];
|
||||||
my $completeReadingName = $devName.":".$readingName;
|
my $completeReadingName = $devName.":".$readingName;
|
||||||
next if ($completeReadingName =~ m/^($exclReadings)$/ );
|
next if ($completeReadingName =~ m/^($exclReadings)$/ );
|
||||||
next if not exists ($dev->{READINGS}{$readingName});
|
- next if not exists ($dev->{READINGS}{$readingName});
|
||||||
$statisticDone = 1;
|
$statisticDone = 1;
|
||||||
if ($$f[1] == 1) { statistics_doStatisticMinMax ($hash, $dev, $readingName, $$f[2], $periodSwitch);}
|
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] == 2) { statistics_doStatisticDelta ($hash, $dev, $readingName, $$f[2], $periodSwitch);}
|
||||||
if ($$f[1] == 3) { statistics_doStatisticDuration ($hash, $dev, $readingName, $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)
|
foreach $readingName (@specialReadings)
|
||||||
{
|
{
|
||||||
my $completeReadingName = $devName.":".$readingName;
|
my $completeReadingName = $devName.":".$readingName;
|
||||||
@ -378,7 +378,7 @@ statistics_DoStatistics($$$)
|
|||||||
statistics_doStatisticDelta ($hash, $dev, $readingName, 1, $periodSwitch);
|
statistics_doStatisticDelta ($hash, $dev, $readingName, 1, $periodSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@specialReadings = split /|/, AttrVal($hashName, "durationReadings", "");
|
@specialReadings = split /,/, AttrVal($hashName, "durationReadings", "");
|
||||||
foreach $readingName (@specialReadings)
|
foreach $readingName (@specialReadings)
|
||||||
{
|
{
|
||||||
my $completeReadingName = $devName.":".$readingName;
|
my $completeReadingName = $devName.":".$readingName;
|
||||||
@ -388,7 +388,7 @@ statistics_DoStatistics($$$)
|
|||||||
statistics_doStatisticDuration ($hash, $dev, $readingName, $periodSwitch);
|
statistics_doStatisticDuration ($hash, $dev, $readingName, $periodSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@specialReadings = split /|/, AttrVal($hashName, "minAvgMaxReadings", "");
|
@specialReadings = split /,/, AttrVal($hashName, "minAvgMaxReadings", "");
|
||||||
foreach $readingName (@specialReadings)
|
foreach $readingName (@specialReadings)
|
||||||
{
|
{
|
||||||
my $completeReadingName = $devName.":".$readingName;
|
my $completeReadingName = $devName.":".$readingName;
|
||||||
@ -890,7 +890,7 @@ statistics_FormatDuration($)
|
|||||||
<a name="statistics"></a>
|
<a name="statistics"></a>
|
||||||
<h3>statistics</h3>
|
<h3>statistics</h3>
|
||||||
<ul style="width:800px">
|
<ul style="width:800px">
|
||||||
Dieses Modul wertet von den angegebenen Geräten bestimmte Werte statistisch aus und fügt sie den jeweiligen Geräten als neue Werte hinzu.
|
Dieses Modul wertet von den angegebenen Geräten (als regulärer Ausdruck) bestimmte Werte statistisch aus und fügt das Ergebnis den jeweiligen Geräten als neue Werte hinzu.
|
||||||
<br>
|
<br>
|
||||||
Derzeit werden Statistiken für folgende Gerätewerte berechnet:
|
Derzeit werden Statistiken für folgende Gerätewerte berechnet:
|
||||||
<ul>
|
<ul>
|
||||||
@ -907,15 +907,14 @@ statistics_FormatDuration($)
|
|||||||
<br>
|
<br>
|
||||||
Beispiel: <code>define Statistik statistics Sensor_.*|Wettersensor</code>
|
Beispiel: <code>define Statistik statistics Sensor_.*|Wettersensor</code>
|
||||||
<br>
|
<br>
|
||||||
|
<li><code><GeräteNameRegExp></code>
|
||||||
|
<br>
|
||||||
|
Regulärer Ausdruck für den Gerätenamen. !!! Nicht die Gerätewerte !!!
|
||||||
|
</li><br>
|
||||||
<li><code>[Prefix]</code>
|
<li><code>[Prefix]</code>
|
||||||
<br>
|
<br>
|
||||||
Optional. Der Prefix wird vor den Namen der statistischen Gerätewerte gesetzt. Standardmässig <i>stat</i>
|
Optional. Der Prefix wird vor den Namen der statistischen Gerätewerte gesetzt. Standardmässig <i>stat</i>
|
||||||
</li><br>
|
</li><br>
|
||||||
<li><code><GeräteNameRegExp></code>
|
|
||||||
<br>
|
|
||||||
Regularer Ausdruck für den Gerätenamen. !!! Nicht die Gerätewerte !!!
|
|
||||||
<br>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@ -947,6 +946,18 @@ statistics_FormatDuration($)
|
|||||||
z.B. "FritzDect:current|Sensor_.*:humidity"
|
z.B. "FritzDect:current|Sensor_.*:humidity"
|
||||||
<br>
|
<br>
|
||||||
</li><br>
|
</li><br>
|
||||||
|
<li><code>deltaReadings <Gerätewerte></code>
|
||||||
|
<br>
|
||||||
|
Durch Kommas getrennte Liste von Gerätewerten
|
||||||
|
</li><br>
|
||||||
|
<li><code>durationReadings <Gerätewerte></code>
|
||||||
|
<br>
|
||||||
|
Durch Kommas getrennte Liste von Gerätewerten
|
||||||
|
</li><br>
|
||||||
|
<li><code>minAvgMaxReadings <Gerätewerte></code>
|
||||||
|
<br>
|
||||||
|
Durch Kommas getrennte Liste von Gerätewerten
|
||||||
|
</li><br>
|
||||||
<li><code>periodChangePreset <Sekunden></code>
|
<li><code>periodChangePreset <Sekunden></code>
|
||||||
<br>
|
<br>
|
||||||
Start der Berechnung der periodischen Daten, standardmässig 10 Sekunden vor der vollen Stunde,
|
Start der Berechnung der periodischen Daten, standardmässig 10 Sekunden vor der vollen Stunde,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user