mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem.pl: suppressReading attribute (Forum #57841)
git-svn-id: https://svn.fhem.de/fhem/trunk@12191 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a54b9ae30c
commit
38fc67d229
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: suppressReading attribute added for all devices (Forum #57841)
|
||||||
- bugfix: 88_HMCCU: Fixed CUxD device datapoint handling
|
- bugfix: 88_HMCCU: Fixed CUxD device datapoint handling
|
||||||
- change: 10_IT: create events during readings update.
|
- change: 10_IT: create events during readings update.
|
||||||
change logging
|
change logging
|
||||||
|
@ -339,64 +339,16 @@ Device specific attributes are documented in the corresponding device section.
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<a name="verbose"></a>
|
|
||||||
<li>verbose<br>
|
|
||||||
Set the verbosity level. Possible values:
|
|
||||||
<ul>
|
|
||||||
<li>0 - server start/stop
|
|
||||||
<li>1 - error messages or unknown packets
|
|
||||||
<li>2 - major events/alarms.
|
|
||||||
<li>3 - commands sent out will be logged.
|
|
||||||
<li>4 - you'll see whats received by the different devices.
|
|
||||||
<li>5 - debugging.</li>
|
|
||||||
</ul>
|
|
||||||
The value for the <a href="#global">global</a> device is a default for
|
|
||||||
other devices without own verbose attribute set.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="comment"></a>
|
|
||||||
<li>comment<br>
|
|
||||||
Add an arbitrary comment.
|
|
||||||
|
|
||||||
<a name="alias"></a>
|
<a name="alias"></a>
|
||||||
<li>alias<br>
|
<li>alias<br>
|
||||||
Used by FHEMWEB to display a device with another name e.g. when using
|
Used by FHEMWEB to display a device with another name e.g. when using
|
||||||
special characters/spaces not accepted by device definition.
|
special characters/spaces not accepted by device definition.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
<a name="room"></a>
|
<a name="comment"></a>
|
||||||
<li>room<br>
|
<li>comment<br>
|
||||||
Filter/group devices. Recognized by web-pgm2 and web-pgm3. A device
|
Add an arbitrary comment.
|
||||||
can appear in more than one room, in this case the rooms have to be
|
</li><br>
|
||||||
specified comma-separated.<br>
|
|
||||||
Devices in the room hidden will not appear in the web output, or set
|
|
||||||
the <a href="#hiddenroom"> FHEMWEB attribute to selectively disable
|
|
||||||
rooms for certain FHEMWEB instances.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="genericDisplayType"></a>
|
|
||||||
<li>genericDisplayType<br>
|
|
||||||
used by some frontends (but not FHEMWEB) to offer a default image or
|
|
||||||
appropriate commands for this device. Currently the following values
|
|
||||||
are supported: switch,outlet,light,blind,speaker,thermostat
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="group"></a>
|
|
||||||
<li>group<br>
|
|
||||||
Group devices. Recognized by web-pgm2 (module <a href="#FHEMWEB">FHEMWEB</a>), it makes
|
|
||||||
devices in the same group appear in the same box).
|
|
||||||
This is used to further group
|
|
||||||
devices together. A device can appear in more than one group, in this
|
|
||||||
case the groups have to be specified comma-separated.<br>
|
|
||||||
If this attribute is not set then the device type is used as the
|
|
||||||
grouping attribute.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="showtime"></a>
|
|
||||||
<li>showtime<br>
|
|
||||||
Used in the webfrontend pgm2 to show the time of last activity
|
|
||||||
instead of the state in the summary view. Useful e.g. for FS20 PIRI
|
|
||||||
devices.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="eventMap"></a>
|
<a name="eventMap"></a>
|
||||||
<li>eventMap<br>
|
<li>eventMap<br>
|
||||||
@ -427,10 +379,64 @@ Device specific attributes are documented in the corresponding device section.
|
|||||||
part with wildcards, the fw part must be filled with the exact same
|
part with wildcards, the fw part must be filled with the exact same
|
||||||
keys to enable a correct display in the FHEMWEB set dropdown list in
|
keys to enable a correct display in the FHEMWEB set dropdown list in
|
||||||
the detail view.
|
the detail view.
|
||||||
|
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="genericDisplayType"></a>
|
||||||
|
<li>genericDisplayType<br>
|
||||||
|
used by some frontends (but not FHEMWEB) to offer a default image or
|
||||||
|
appropriate commands for this device. Currently the following values
|
||||||
|
are supported: switch,outlet,light,blind,speaker,thermostat
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="group"></a>
|
||||||
|
<li>group<br>
|
||||||
|
Group devices. Recognized by web-pgm2 (module <a
|
||||||
|
href="#FHEMWEB">FHEMWEB</a>), it makes
|
||||||
|
devices in the same group appear in the same box).
|
||||||
|
This is used to further group
|
||||||
|
devices together. A device can appear in more than one group, in this
|
||||||
|
case the groups have to be specified comma-separated.<br>
|
||||||
|
If this attribute is not set then the device type is used as the
|
||||||
|
grouping attribute.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="room"></a>
|
||||||
|
<li>room<br>
|
||||||
|
Filter/group devices. Recognized by web-pgm2 and web-pgm3. A device
|
||||||
|
can appear in more than one room, in this case the rooms have to be
|
||||||
|
specified comma-separated.<br>
|
||||||
|
Devices in the room hidden will not appear in the web output, or set
|
||||||
|
the <a href="#hiddenroom"> FHEMWEB attribute to selectively disable
|
||||||
|
rooms for certain FHEMWEB instances.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="suppressReading"></a>
|
||||||
|
<li>suppressReading<br>
|
||||||
|
Used to eliminate unwanted readings. The value is a regular expression,
|
||||||
|
with ^ and $ added. Only necessary in exceptional cases.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="showtime"></a>
|
||||||
|
<li>showtime<br>
|
||||||
|
Used in the webfrontend pgm2 to show the time of last activity
|
||||||
|
instead of the state in the summary view. Useful e.g. for FS20 PIRI
|
||||||
|
devices.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="verbose"></a>
|
||||||
|
<li>verbose<br>
|
||||||
|
Set the verbosity level. Possible values:
|
||||||
|
<ul>
|
||||||
|
<li>0 - server start/stop</li>
|
||||||
|
<li>1 - error messages or unknown packets</li>
|
||||||
|
<li>2 - major events/alarms.</li>
|
||||||
|
<li>3 - commands sent out will be logged.</li>
|
||||||
|
<li>4 - you'll see whats received by the different devices.</li>
|
||||||
|
<li>5 - debugging.</li>
|
||||||
|
</ul>
|
||||||
|
The value for the <a href="#global">global</a> device is a default for
|
||||||
|
other devices without own verbose attribute set.
|
||||||
|
</li></br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="readingFnAttributes"></a>
|
<a name="readingFnAttributes"></a>
|
||||||
|
@ -338,66 +338,17 @@ Gerät dokumentiert.
|
|||||||
<h4>Globale Attribute für alle Geräte</h4>
|
<h4>Globale Attribute für alle Geräte</h4>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<a name="verbose"></a>
|
<a name="alias"></a>
|
||||||
<li>verbose<br>
|
<li>alias<br>
|
||||||
Setzt den Schwellwert für die Logfile-Meldungen.
|
Wird in FHEMWEB benutzt, um ein en anderen Namen für ein Gerät
|
||||||
Mögliche Werte sind:
|
anzuzeigen z.B. wenn Sonderzeichen/Leerzeichen nicht in der
|
||||||
<ul>
|
Gerätedefinition verwendet werden können.
|
||||||
<li>0 - Server start/stop
|
</li><br>
|
||||||
</li><li>1 - Fehlermeldungen oder unbekannte Pakete
|
|
||||||
</li><li>2 - bedeutende Ereigbisse/Alarme.
|
|
||||||
</li><li>3 - ausgesendete Kommandos werden gelogged.
|
|
||||||
</li><li>4 - von den einzelnen Geräten empfangene Daten.
|
|
||||||
</li><li>5 - Fehlersuche.</li>
|
|
||||||
</ul>
|
|
||||||
Der für die <a href="#global">global</a> Instanz gesetzte Wert gilt
|
|
||||||
als Voreinstellung für die Instanzen, die dieses Attribut nicht
|
|
||||||
gesetzt haben.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="comment"></a>
|
<a name="comment"></a>
|
||||||
<li>comment<br>
|
<li>comment<br>
|
||||||
Fügt einen beliebigen Kommentar hinzu.
|
Fügt einen beliebigen Kommentar hinzu.
|
||||||
|
</li><br>
|
||||||
<a name="alias"></a>
|
|
||||||
</li><li>alias<br>
|
|
||||||
Wird in FHEMWEB benutzt, um ein en anderen Namen für ein Gerät
|
|
||||||
anzuzeigen z.B. wenn Sonderzeichen/Leerzeichen nicht in der
|
|
||||||
Gerätedefinition verwendet werden können.
|
|
||||||
|
|
||||||
<a name="room"></a>
|
|
||||||
</li><li>room<br>
|
|
||||||
Filtert/gruppiert Geräte.
|
|
||||||
Ein Gerät kann zu mehr als einem Raum zugeordnet werden. In diesem
|
|
||||||
Fall müssen die Raumzuordnungen durch Kommata getrennt
|
|
||||||
angegeben werden.<br>
|
|
||||||
Geräte, die dem Raum mit der Bezeichnung "hidden" zugeordnet
|
|
||||||
werden, erscheinen nicht auf der Webseite.
|
|
||||||
|
|
||||||
<a name="genericDisplayType"></a>
|
|
||||||
<li>genericDisplayType<br>
|
|
||||||
Wird von bestimmten Frontends (aber nicht FHEMWEB) verwendet, um
|
|
||||||
für das Gerät passende Voreinstellungen (Bild/Befehle/etc)
|
|
||||||
anzubieten. Z.Zt werden folgende Werte unterstützt:
|
|
||||||
switch,outlet,light,blind,speaker,thermostat
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="group"></a>
|
|
||||||
<li>group<br>
|
|
||||||
Gerätegruppen. FHEMWEB zeigt Geräte die in die gleiche Gruppe
|
|
||||||
gehören auch in einer gemeinsamen Box an. Ein Gerät kann zu
|
|
||||||
mehr als einer Gruppe gehören. In diesem Fall müssen die
|
|
||||||
entsprechenden Gruppen durch Kommata getrennt eingetragen werden. Wenn
|
|
||||||
dieses Attribut nicht gesetzt ist, wird der in der Gerätegruppe
|
|
||||||
gesetzte Gerätetyp verwendet.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="showtime"></a>
|
|
||||||
<li>showtime<br>
|
|
||||||
Wird im FHEMWEB verwendet, um die Zeit der letzten Aktivität
|
|
||||||
anstelle des Status in der Gesamtansicht anzuzeigen. Nützlich z.B.
|
|
||||||
für FS20 PIRI Geräte.
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<a name="eventMap"></a>
|
<a name="eventMap"></a>
|
||||||
<li>eventMap<br>
|
<li>eventMap<br>
|
||||||
@ -434,6 +385,65 @@ Gerät dokumentiert.
|
|||||||
richtig anzeigen kann.
|
richtig anzeigen kann.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<a name="genericDisplayType"></a>
|
||||||
|
<li>genericDisplayType<br>
|
||||||
|
Wird von bestimmten Frontends (aber nicht FHEMWEB) verwendet, um
|
||||||
|
für das Gerät passende Voreinstellungen (Bild/Befehle/etc)
|
||||||
|
anzubieten. Z.Zt werden folgende Werte unterstützt:
|
||||||
|
switch,outlet,light,blind,speaker,thermostat
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="group"></a>
|
||||||
|
<li>group<br>
|
||||||
|
Gerätegruppen. FHEMWEB zeigt Geräte die in die gleiche Gruppe
|
||||||
|
gehören auch in einer gemeinsamen Box an. Ein Gerät kann zu
|
||||||
|
mehr als einer Gruppe gehören. In diesem Fall müssen die
|
||||||
|
entsprechenden Gruppen durch Kommata getrennt eingetragen werden. Wenn
|
||||||
|
dieses Attribut nicht gesetzt ist, wird der in der Gerätegruppe
|
||||||
|
gesetzte Gerätetyp verwendet.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="room"></a>
|
||||||
|
<li>room<br>
|
||||||
|
Filtert/gruppiert Geräte.
|
||||||
|
Ein Gerät kann zu mehr als einem Raum zugeordnet werden. In diesem
|
||||||
|
Fall müssen die Raumzuordnungen durch Kommata getrennt
|
||||||
|
angegeben werden.<br>
|
||||||
|
Geräte, die dem Raum mit der Bezeichnung "hidden" zugeordnet
|
||||||
|
werden, erscheinen nicht auf der Webseite.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="showtime"></a>
|
||||||
|
<li>showtime<br>
|
||||||
|
Wird im FHEMWEB verwendet, um die Zeit der letzten Aktivität
|
||||||
|
anstelle des Status in der Gesamtansicht anzuzeigen. Nützlich z.B.
|
||||||
|
für FS20 PIRI Geräte.
|
||||||
|
</li></br>
|
||||||
|
|
||||||
|
<a name="suppressReading"></a>
|
||||||
|
<li>suppressReading<br>
|
||||||
|
Wird verwendet, um nicht gewollte Readings zu entfernen. Der Wert ist
|
||||||
|
ein Regular Expression, ergänzt mit ^ und $. Wird nur in
|
||||||
|
Ausnahmefällen benötigt.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
|
<a name="verbose"></a>
|
||||||
|
<li>verbose<br>
|
||||||
|
Setzt den Schwellwert für die Logfile-Meldungen.
|
||||||
|
Mögliche Werte sind:
|
||||||
|
<ul>
|
||||||
|
<li>0 - Server start/stop</li>
|
||||||
|
<li>1 - Fehlermeldungen oder unbekannte Pakete</li>
|
||||||
|
<li>2 - bedeutende Ereigbisse/Alarme.</li>
|
||||||
|
<li>3 - ausgesendete Kommandos werden gelogged.</li>
|
||||||
|
<li>4 - von den einzelnen Geräten empfangene Daten.</li>
|
||||||
|
<li>5 - Fehlersuche.</li>
|
||||||
|
</ul>
|
||||||
|
Der für die <a href="#global">global</a> Instanz gesetzte Wert gilt
|
||||||
|
als Voreinstellung für die Instanzen, die dieses Attribut nicht
|
||||||
|
gesetzt haben.
|
||||||
|
</li><br>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
15
fhem/fhem.pl
15
fhem/fhem.pl
@ -233,8 +233,10 @@ use vars qw(@structChangeHist); # Contains the last 10 structural changes
|
|||||||
$selectTimestamp = gettimeofday();
|
$selectTimestamp = gettimeofday();
|
||||||
$cvsid = '$Id$';
|
$cvsid = '$Id$';
|
||||||
|
|
||||||
my $AttrList = "verbose:0,1,2,3,4,5 room group comment:textField-long alias ".
|
my $AttrList = "alias comment:textField-long eventMap group room ".
|
||||||
"eventMap userReadings:textField-long";
|
"suppressReading userReadings:textField-long ".
|
||||||
|
"verbose:0,1,2,3,4,5";
|
||||||
|
|
||||||
my $currcfgfile=""; # current config/include file
|
my $currcfgfile=""; # current config/include file
|
||||||
my $currlogfile; # logfile, without wildcards
|
my $currlogfile; # logfile, without wildcards
|
||||||
my $duplidx=0; # helper for the above pool
|
my $duplidx=0; # helper for the above pool
|
||||||
@ -2568,6 +2570,12 @@ CommandAttr($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($attrName eq "suppressReading") {
|
||||||
|
return "Argument must be a valid regexp" if(!$a[2] || $a[2] =~ /^\*/);
|
||||||
|
eval { "Hallo" =~ m/^$a[2]$/ };
|
||||||
|
return "Bad regexp: $@" if($@);
|
||||||
|
}
|
||||||
|
|
||||||
$a[0] = $sdev;
|
$a[0] = $sdev;
|
||||||
my $oVal = ($attr{$sdev} ? $attr{$sdev}{$attrName} : "");
|
my $oVal = ($attr{$sdev} ? $attr{$sdev}{$attrName} : "");
|
||||||
$ret = CallFn($sdev, "AttrFn", "set", @a);
|
$ret = CallFn($sdev, "AttrFn", "set", @a);
|
||||||
@ -4053,6 +4061,9 @@ readingsBulkUpdate($$$@)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $sp = AttrVal($name, "suppressReading", undef);
|
||||||
|
return if($sp && $reading =~ m/^$sp$/);
|
||||||
|
|
||||||
# shorthand
|
# shorthand
|
||||||
my $readings = $hash->{READINGS}{$reading};
|
my $readings = $hash->{READINGS}{$reading};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user