diff --git a/fhem/FHEM/98_monitoring.pm b/fhem/FHEM/98_monitoring.pm
index a62b0bacb..8c055ff6b 100644
--- a/fhem/FHEM/98_monitoring.pm
+++ b/fhem/FHEM/98_monitoring.pm
@@ -566,20 +566,22 @@ sub monitoring_setInactive($) {
1;
+__END__
+
# commandref ##################################################################
=pod
=item helper
+=encoding utf8
=item summary monitors devices towards events and stores them in two lists
=item summary_DE überwacht Geräte auf Events und speichert diese in zwei Listen
=begin html
-
+
monitoring
-( en | de )
- Each monitoring has a warning and an error list, which are stored
+ Each monitoring has a warning- and an error list, which are stored
as readings.
When a defined add-event occurs, the device is set to the warning
list after a predefined time.
@@ -591,7 +593,7 @@ sub monitoring_setInactive($) {
formatted by two attributes.
The following applications are possible and are described
- below:
+ below:
- opened windows
- battery warnings
@@ -606,14 +608,14 @@ sub monitoring_setInactive($) {
- The monitor does not send a message by itself, a notify or DOIF is
+ The monitor does not send a message by itself, a notify
+ or DOIF is
necessary, which responds to the event "<monitoring-name> error
add: <name>" and then sends the return value of "get
<monitoring-name> default".
-
-
- Define
+
+ Define
define <name> monitoring <add-event> [<remove-event>]
@@ -626,32 +628,31 @@ sub monitoring_setInactive($) {
both lists as it occurs and the timers for warning and error are
started.
-
-
- Set
+
+ Set
- -
+
-
active
Two things will happen:
1. Restores pending timers, or sets the devices immediately to the
corresponding list if the time is in the past.
2. Executes the commands specified under the "setActiveFunc" attribute.
- -
+
-
clear (warning|error|all)
Removes all devices from the specified list and aborts timers for this
list. With "all", all devices are removed from both lists and all
running timers are aborted.
- -
+
-
errorAdd <name>
Add <name> to the error list.
- -
+
-
errorRemove <name>
Removes <name> from the error list.
- -
+
-
inactive
Two things will happen:
1. Executes the commands specified under the "setInactiveFunc" attribute.
@@ -659,45 +660,43 @@ sub monitoring_setInactive($) {
disable attribute: using set inactive the state is automatically saved
to the statefile on shutdown, there is no explicit save necesary.
- -
+
-
warningAdd <name>
Add <name> to the warning list.
- -
+
-
warningRemove <name>
Removes <name> from the warning list.
-
-
- Get
+
+ Get
- -
+
-
all
Returns the error and warning list, separated by a blank line.
The formatting can be set with the attributes "errorReturn" and
"warningReturn".
- -
+
-
default
The "default" value can be set in the attribute "getDefault" and is
intended to leave the configuration for the return value in the
monitoring device. If nothing is specified "all" is used.
- -
+
-
error
Returns the error list.
The formatting can be set with the attribute "errorReturn".
- -
+
-
warning
Returns the warning list.
The formatting can be set with the attribute "warningReturn".
-
-
- Readings
+
+ Readings
-
allCount
@@ -734,33 +733,32 @@ sub monitoring_setInactive($) {
Displays the amount of devices on the warning list.
-
-
- Attribute
+
+ Attributes
-
addStateEvent
- -
+
-
blacklist
Space-separated list of devspecs which will be ignored.
If the attribute is set all devices which are specified by the devspecs
are removed from both lists.
- -
+
-
disable (1|0)
1: Executes the commands specified under the "setInactiveFunc" attribute
and disables the monitoring.
- 0: see "set active"
+ 0: see "set active"
-
disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM ...
- -
+
-
errorFuncAdd {<perl code>}
The following variables are available in this function:
@@ -792,7 +790,7 @@ sub monitoring_setInactive($) {
If the attribute is not set, it will be checked for
$addMatch
.
- -
+
-
errorFuncAdded {<perl code>}
The following variables are available in this function:
@@ -808,7 +806,7 @@ sub monitoring_setInactive($) {
This function will be executed when a device is added to the error list.
- -
+
-
errorFuncRemove {<perl code>}
This function provides the same variables as for "errorFuncAdd".
If the function returns a 1, the device is removed from the error list
@@ -818,11 +816,11 @@ sub monitoring_setInactive($) {
<remove-event>
in the DEF, otherwise it will be
checked for errorFuncAdd
.
- -
+
-
errorWait <perl code>
- Wait until the device is set to the error list.
+ Code returning waiting time (in seconds) until the device is set to the error list.
- -
+
-
errorReturn {<perl code>}
The following variables are available in this attribute:
@@ -842,41 +840,46 @@ sub monitoring_setInactive($) {
With this attribute the output created with "get <name> error"
can be formatted.
- -
+
-
getDefault (all|error|warning)
This attribute can be used to specify which list(s) are / are returned
by "get <name> default". If the attribute is not set, "all" will
be used.
- -
-
setActiveFunc <Anweisung>
+ -
+
setActiveFunc <statement>
The statement is one of the FHEM command types and is executed when you
define the monitoring or "set active".
For a battery message "trigger battery=low battery: low"
can be useful.
- -
+
-
+
setInactiveFunc <statement>
+ The statement is one of the FHEM command types and is executed when you
+ define the monitoring or "set inactive".
+
+ -
warningFuncAdd {<perl code>}
Like errorFuncAdd, just for the warning list.
- -
-
warningFuncAdd {<perl code>}
+ -
+
warningFuncAdded {<perl code>}
Like errorFuncAdded, just for the warning list.
- -
+
-
warningFuncRemove {<perl code>}
Like errorFuncRemove, just for the warning list.
- -
+
-
warningWait <perl code>
Like errorWait, just for the warning list.
- -
+
-
warningReturn {<perl code>}
Like errorReturn, just for the warning list.
- -
-
whitelist {<perl code>}
+ -
+
whitelist {<devspec list>}
Space-separated list of devspecs which are allowed.
If the attribute is set all devices which are not specified by the
devspecs are removed from both lists.
@@ -887,9 +890,8 @@ sub monitoring_setInactive($) {
-
-
-
Examples
+
+
Examples
The following sample codes can be imported via "Raw definition".
@@ -1073,24 +1075,23 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
=begin html_DE
-
+
monitoring
-( en | de )
- Jedes monitoring verfügt über eine warning- und eine error-Liste,
+ Jedes monitoring verfügt über eine warning- und eine error-Liste,
welche als Readings gespeichert werden.
- Beim auftreten eines definierten add-events wird das Gerät nach einer
+ Beim Auftreten eines definierten add-events wird das Gerät nach einer
vorgegeben Zeit auf die warning-Liste gesetzt.
Nach einer weiteren vorgegeben Zeit wird das Gerät von der
warning-Liste gelöscht und auf die error-Liste gesetzt.
- Beim auftreten eines definierten remove-events wird das Gerät von
+ Beim Auftreten eines definierten remove-events wird das Gerät von
beiden Listen gelöscht und noch laufende Timer abgebrochen.
Hiermit lassen sich auf einfache Weise Sammelmeldungen erstellen und durch
zwei Attribute formatiert ausgeben.
Folgende Anwendungen sind möglich und werden
- unten beschrieben:
+ unten beschrieben:
- geöffnete Fenster
- Batterie Warnungen
@@ -1105,14 +1106,13 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
- Das monitor sendet selbst keine Benachrichtung, hierfür ist ein notify
- oder DOIF notwendig, welches auf das Event "<monitoring-name> error
+ Das monitor sendet selbst keine Benachrichtung, hierfür ist ein notify
+ oder DOIF notwendig, welches auf das Event "<monitoring-name> error
add: <name>" reagiert und dann den Rückgabewert von
"get <monitoring-name> default" versendet.
-
-
- Define
+
+ Define
define <name> monitoring <add-event> [<remove-event>]
@@ -1120,17 +1120,16 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
Die Syntax für <add-event> und <remove-event> ist die
gleiche wie für das Suchmuster von
- notify (Gerätename
+ notify (Gerätename
oder Gerätename:Event).
Ist nur ein <add-event> definiert wird beim auftreten das
Gerät von beiden Listen gelöscht und die Timer für warning
und error werden gestartet.
-
-
- Set
+
+ Set
- -
+
-
active
Es passieren zwei Dinge:
1. Stellt noch ausstehende Timer wieder her, bzw. setzt die Geräte
@@ -1139,70 +1138,68 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
2. Führt die unter dem Attribut "setActiveFunc" angegeben Befehle
aus.
- -
+
-
clear (warning|error|all)
Entfernt alle Geräte von der angegeben Liste und bricht für
diese Liste laufende Timer ab. Bei "all" werden alle Geräte von
beiden Listen entfernt und alle laufenden Timer abgebrochen.
- -
+
-
errorAdd <name>
Fügt <name> zu der error-Liste hinzu.
- -
+
-
errorRemove <name>
Entfernt <name> von der error-Liste.
- -
+
-
inactive
Deaktiviert das monitoring. Beachte den leichten semantischen
Unterschied zum disable Attribut: "set inactive" wird bei einem
shutdown automatisch in fhem.state gespeichert, es ist kein save
notwendig.
- -
+
-
warningAdd <name>
Fügt <name> zu der warning-Liste hinzu.
- -
+
-
warningRemove <name>
Entfernt <name> von der warning-Liste.
-
-
- Get
+
+ Get
- -
+
-
all
Gibt, durch eine Leerzeile getrennt, die error- und warning-Liste
zurück.
Die Formatierung kann dabei mit den Attributen "errorReturn" und
"warningReturn" eingestellt werden.
- -
+
-
default
Der "default" Wert kann in dem Attribut "getDefault" festgelegt werden
und ist dazu gedacht um die Konfiguration für den
Rückgabewert im monitoring Gerät zu belassen. Wird nichts
angegeben wird "all" verwendent.
- -
+
-
error
Gibt die error-Liste zurück.
Die Formatierung kann dabei mit dem Attribut "errorReturn" eingestellt
werden.
- -
+
-
warning
Gibt die warning-Liste zurück.
Die Formatierung kann dabei mit dem Attribut "warningReturn"
eingestellt werden.
-
-
- Readings
+
+ Readings
-
allCount
@@ -1241,22 +1238,21 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
Zeigt die Anzahl der Geräte in der warning-Liste an.
-
-
- Attribute
+
+ Attribute
-
addStateEvent
- -
+
-
blacklist
Durch Leerzeichen getrennte Liste von devspecs die ignoriert werden.
Wenn das Attribut gesetzt wird werden alle Geräte die durch die
devspecs definiert sind von beiden Listen gelöscht.
- -
+
-
disable (1|0)
1: Deaktiviert das monitoring.
0: siehe "set active"
@@ -1266,7 +1262,7 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM ...
- -
+
-
errorFuncAdd {<perl code>}
In dieser Funktion stehen die folgende Variablen zur Verfügung:
@@ -1298,7 +1294,7 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
Wenn das Attribut nicht gesetzt ist wird auf $addMatch
geprüft.
- -
+
-
errorFuncAdded {<perl code>}
In dieser Funktion stehen die folgende Variablen zur Verfügung:
@@ -1314,7 +1310,7 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
Diese Funktion wird ausgeführt, wenn ein Gerät in die Fehlerliste aufgenommen wird.
- -
+
-
errorFuncRemove {<perl code>}
In dieser Funktion stehen die selben Variablen wie bei "errorFuncAdd"
zur Verfügung.
@@ -1325,11 +1321,11 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
geprüft und bei einer DEF ohne <remove-event>
auf errorFuncAdd
.
- -
+
-
errorWait <perl code>
- Wartezeit bis das Gerät auf die error-Liste gesetzt wird.
+ Wartezeit (Rückgabe in Sekunden) bis das Gerät auf die error-Liste gesetzt wird.
- -
+
-
errorReturn {<perl code>}
In diesem Attribut stehen folgende Variablen zur Verfügung:
@@ -1349,41 +1345,48 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
Mit diesem Attribut kann die Ausgabe die mit "get <name> error"
erzeugt wird angepasst werden.
- -
+
-
getDefault (all|error|warning)
Mit diesem Attribut kann festgelegt werden welche Liste/n mit "get
<name> default" zurück gegeben wird/werden. Wenn das
Attribut nicht gesetzt ist wird "all" verwendet.
- -
+
-
setActiveFunc <Anweisung>
Die Anweisung ist einer der FHEM
- Befehlstypen und wird beim definieren des
+ Befehlstypen und wird beim Definieren des
monitoring oder bei "set active" ausgeführt.
Für eine Batterie Meldung kann "trigger battery=low
battery:low"
sinnvoll sein.
- -
+
-
+
setInactiveFunc <Anweisung>
+ Die Anweisung ist einer der FHEM
+ Befehlstypen und wird beim Definieren des
+ monitoring oder bei "set inactive" ausgeführt.
+
+
+ -
warningFuncAdd {<perl code>}
Wie errorFuncAdd, nur für die warning-Liste.
- -
+
-
warningFuncAdded {<perl code>}
Wie errorFuncAdded, nur für die warning-Liste.
- -
+
-
warningFuncRemove {<perl code>}
Wie errorFuncRemove, nur für die warning-Liste.
- -
+
-
warningWait <perl code>
Wie errorWait, nur für die warning-Liste.
- -
+
-
warningReturn {<perl code>}
Wie errorReturn, nur für die warning-Liste.
- -
+
-
whitelist {<perl code>}
Durch Leerzeichen getrennte Liste von devspecs die erlaubt sind
werden.
@@ -1396,9 +1399,8 @@ attr BeamerFilter_monitoring warningFuncRemove {return}
-
-
-
Beispiele
+
+
Beispiele