diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index f7ce6c726..1aaf99c8a 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -484,10 +484,10 @@ attribute list if you want to know if a device supports these attributes.
readings over time periods and to throttle the update rate of readings and thus the amount of data written to the logs.

- This attribute takes a comma-separated list of reading:interval:method:function - quadruples. You may use regular expressions for reading. If set, updates for the + This attribute takes a comma-separated list of reading:interval:method:function:holdTime + quintuples. You may use regular expressions for reading. If set, updates for the listed readings are ignored and associated events are suppressed for a black-out period of at - least interval seconds. After the black-out period has expired, the reading is + least interval seconds (downsampling). After the black-out period has expired, the reading is updated with a value that is calculated from the values and timestamps of the previously ignored updates within the black-out period as follows: @@ -499,7 +499,11 @@ attribute list if you want to know if a device supports these attributes.
maxthe largest value encountered meanthe arithmetic mean of all values sdthe standard deviation from the mean + medianthe median of all values (requires holdTime and function none) integralthe arithmetic sum (if not time-weighted) or integral area (if time-weighted) of all values + nnumber of samples + ttimestamp of the last value + t0timestamp of the first value

@@ -517,14 +521,26 @@ attribute list if you want to know if a device supports these attributes.
the none method with the v function is used. The constant method is for discrete quantities that stay constant until the corresponding reading is updated, e.g. counters, switches and the like.

- + + If the holdTime in seconds is defined, the samples will be kept in memory allowing + the calculation of floating statistics instead of blocked statistics. With holdTime + defined the interval can be kept undefined so that the readings update rate is unchanged + or it can be set to a value less then holdTime for downsampling as described above + with a full history of the readings in memory. Note that the historic samples are not persistent + and will be lost when restarting FHEM.

+ The event aggregator only takes into consideration those updates that remain after preprocessing according to the event-on-update-reading and event-on-change-reading directives. Besides which, any update of a reading that occurs within a timespan from the preceding update that is smaller than the resolution of FHEM's time granularity is ditched.

+ + When more than one function should be calculated for the same reading, the original reading must be + multiplied (e.g. by using a notify) before applying the event-aggregator to the derived readings.

- Example:
- attr myPowerMeter event-aggregator EP_POWER_METER:300:linear:mean,EP_ENERGY_METER:300:none:v + Examples:
+ attr myPowerMeter event-aggregator EP_POWER_METER:300:linear:mean,EP_ENERGY_METER:300:none:v
+ attr myBadSensor event-aggregator TEMP::none:median:300
+ attr mySunMeter event-aggregator SUN_INTENSITY_24H::const:integral:86400

diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index 57b1f6862..03cd908b2 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -456,10 +456,10 @@ Gerät dokumentiert. readings over time periods and to throttle the update rate of readings and thus the amount of data written to the logs.

- This attribute takes a comma-separated list of reading:interval:method:function - quadruples. You may use regular expressions for reading. If set, updates for the + This attribute takes a comma-separated list of reading:interval:method:function:holdTime + quintuples. You may use regular expressions for reading. If set, updates for the listed readings are ignored and associated events are suppressed for a black-out period of at - least interval seconds. After the black-out period has expired, the reading is + least interval seconds (downsampling). After the black-out period has expired, the reading is updated with a value that is calculated from the values and timestamps of the previously ignored updates within the black-out period as follows: @@ -471,7 +471,11 @@ Gerät dokumentiert. maxthe largest value encountered meanthe arithmetic mean of all values sdthe standard deviation from the mean + medianthe median of all values (requires holdTime and function none) integralthe arithmetic sum (if not time-weighted) or integral area (if time-weighted) of all values + nnumber of samples + ttimestamp of the last value + t0timestamp of the first value

@@ -489,14 +493,26 @@ Gerät dokumentiert. the none method with the v function is used. The constant method is for discrete quantities that stay constant until the corresponding reading is updated, e.g. counters, switches and the like.

- + + If the holdTime in seconds is defined, the samples will be kept in memory allowing + the calculation of floating statistics instead of blocked statistics. With holdTime + defined the interval can be kept undefined so that the readings update rate is unchanged + or it can be set to a value less then holdTime for downsampling as described above + with a full history of the readings in memory. Note that the historic samples are not persistent + and will be lost when restarting FHEM.

+ The event aggregator only takes into consideration those updates that remain after preprocessing according to the event-on-update-reading and event-on-change-reading directives. Besides which, any update of a reading that occurs within a timespan from the preceding update that is smaller than the resolution of FHEM's time granularity is ditched.

+ + When more than one function should be calculated for the same reading, the original reading must be + multiplied (e.g. by using a notify) before applying the event-aggregator to the derived readings.

- Example:
- attr myPowerMeter event-aggregator EP_POWER_METER:300:linear:mean,EP_ENERGY_METER:300:none:v + Examples:
+ attr myPowerMeter event-aggregator EP_POWER_METER:300:linear:mean,EP_ENERGY_METER:300:none:v
+ attr myBadSensor event-aggregator TEMP::none:median:300
+ attr mySunMeter event-aggregator SUN_INTENSITY_24H::const:integral:86400 diff --git a/fhem/fhem.pl b/fhem/fhem.pl index b8c361aa5..d9822b9df 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -4056,13 +4056,13 @@ readingsBulkUpdate($$$@) ($reading=~ m/^$l$/) ? $_ : undef} @{$hash->{".attraggr"}}; if(@v) { # e.g. power:20:linear:avg - my (undef, $duration, $method, $function) = split(":", $v[0], 4); + my (undef, $duration, $method, $function, $holdTime) = split(":", $v[0], 5); my $ts; if(defined($readings->{".ts"})) { $ts= $readings->{".ts"}; } else { require "TimeSeries.pm"; - $ts= TimeSeries->new( { method => $method, autoreset => $duration } ); + $ts= TimeSeries->new( { method => $method, autoreset => $duration, holdTime => $holdTime } ); $readings->{".ts"}= $ts; # access from command line: # { $defs{"myClient"}{READINGS}{"myValue"}{".ts"}{max} }