2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

Documentating stateFormat / showInternalValues

git-svn-id: https://svn.fhem.de/fhem/trunk@2413 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-01-03 13:08:39 +00:00
parent 7652a03688
commit 3ffe8765aa
4 changed files with 144 additions and 72 deletions

View File

@ -31,14 +31,23 @@
- bugfix: rename may overwrite other devices - bugfix: rename may overwrite other devices
- feature: FLOORPLAN longpoll (Matthias) - feature: FLOORPLAN longpoll (Matthias)
- feature: support for recurring events added in 57_Calendar.pm (Boris) - feature: support for recurring events added in 57_Calendar.pm (Boris)
- feature: added support for OWL CM119,CM160 and CM180, energy sensors in TRX_WEATHER using RFXtrx433 (Willi Herzig) - feature: added support for OWL CM119,CM160 and CM180, energy sensors in
- feature: added support for KD101 smoke sensor (also set alert and pair) in TRX_SECURITY using RFXtrx433 (Willi Herzig) TRX_WEATHER using RFXtrx433 (Willi Herzig)
- change: changed dewpoint to work with event-on-change-reading and technoline TX3TH (Willi Herzig) - feature: added support for KD101 smoke sensor (also set alert and pair) in
TRX_SECURITY using RFXtrx433 (Willi Herzig)
- change: changed dewpoint to work with event-on-change-reading and
technoline TX3TH (Willi Herzig)
- feature: new command fheminfo. Shows system informations. (M. Fischer) - feature: new command fheminfo. Shows system informations. (M. Fischer)
- feature: added support for UV sensors in TRX_LIGHT using RFXtrx433 (Willi Herzig) - feature: added support for UV sensors in TRX_LIGHT using RFXtrx433 (Willi
- feature: added on-till and on-timer for set in TRX_LIGHT using RFXtrx433 (Willi Herzig) Herzig)
- feature: generate devices with hexcodes as state for unknown types in TRX_ELSE using RFXtrx433 (Willi Herzig) - feature: added on-till and on-timer for set in TRX_LIGHT using RFXtrx433
- feature: new modules 10_OWServer.pm and 11_OWDevice.pm to interface with OWFS (Willi Herzig)
- feature: generate devices with hexcodes as state for unknown types in
TRX_ELSE using RFXtrx433 (Willi Herzig)
- feature: new modules 10_OWServer.pm and 11_OWDevice.pm to interface with
OWFS
- feature: stateFormat (readingsFn modules) and showInternalValues attributes
- feature: new readingsFn modules: FS20 CUL_WS HMS CUL_EM CUL_TX EnOcean ZWave
- 2012-10-28 (5.3) - 2012-10-28 (5.3)
- feature: added functions trim, ltrim, rtrim, UntoggleDirect, - feature: added functions trim, ltrim, rtrim, UntoggleDirect,

View File

@ -61,26 +61,34 @@ foreach my $lang (@lang) {
foreach my $mod (sort keys %mods) { foreach my $mod (sort keys %mods) {
my $tag; my $tag;
my %tagcount= (); my %tagcount= ();
my %llwct = (); # Last line with closed tag
open(MOD, $mods{$mod}) || die("Cant open $mods{$mod}:$!\n"); open(MOD, $mods{$mod}) || die("Cant open $mods{$mod}:$!\n");
my $skip = 1; my $skip = 1;
my $line = 0;
while(my $l = <MOD>) { while(my $l = <MOD>) {
$line++;
if($l =~ m/^=begin html$suffix$/) { if($l =~ m/^=begin html$suffix$/) {
$l = <MOD>; # skip one line, to be able to repeat join+split $l = <MOD>; # skip one line, to be able to repeat join+split
$skip = 0; $skip = 0; $line++;
} elsif($l =~ m/^=end html$suffix/) { } elsif($l =~ m/^=end html$suffix/) {
$skip = 1; $skip = 1;
} elsif(!$skip) { } elsif(!$skip) {
# here we copy line by line from the module # here we copy line by line from the module
print OUT $l; print OUT $l;
foreach $tag (TAGS) { foreach $tag (TAGS) {
$tagcount{$tag}+= ($l =~ /<$tag>/i); my $ot = ($tagcount{$tag} ? $tagcount{$tag} : 0);
$tagcount{$tag}-= ($l =~ /<\/$tag>/i); $tagcount{$tag} +=()= ($l =~ /<$tag>/gi);
$tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi);
$llwct{$tag} = $line if(!$llwct{$tag} || ($ot && !$tagcount{$tag}));
#print "$mod $line $tag $tagcount{$tag}\n" if($tagcount{$tag} ne $ot);
} }
} }
} }
close(MOD); close(MOD);
foreach $tag (TAGS) { foreach $tag (TAGS) {
print("$lang $mods{$mod}: Unbalanced $tag\n") if($tagcount{$tag}); print("$lang $mods{$mod}: Unbalanced $tag ".
"($tagcount{$tag}, last line ok: $llwct{$tag})\n")
if($tagcount{$tag});
} }
} }

View File

@ -326,32 +326,50 @@ A line ending with \ will be concatenated with the next one, so long lines
devices. devices.
</li> </li>
<br><br>The following attributes are honored by the modules that make use <br>
of the standardized readings updating mechanism in fhem.pl. Check the modules <a name="readingFnAttributes"></a>
Attributes list if you want to know if it is supporting it. <b>readingFnAttributes</b><br>
<br><br> The following attributes are honored by the modules that make use
of the standardized readings updating mechanism in fhem.pl. Check the
modules attribute list if you want to know if it is supporting it.
<a name="stateFormat"></a>
<li>stateFormat<br>
Modifies the STATE of the device, shown by the list command or in the room
overview in FHEMWEB. If not set, its value is taken from the state reading.
If set, then every word in the argument is replaced by the value of the
reading if such a reading for the current device exists. If the value of
this attribute is enclused in {}, then it is evaluated. This attribute is
evaluated each time a reading is updated.
</li>
<a name="event-on-update-reading"></a> <a name="event-on-update-reading"></a>
<li>event-on-update-reading<br> <li>event-on-update-reading<br>
If not set, every update of any reading creates an event, which e.g. is handled If not set, every update of any reading creates an event, which e.g. is
by <a href="#notify">notify</a> or <a href="#FileLog">FileLog</a>. The attribute takes handled by <a href="#notify">notify</a> or <a href="#FileLog">FileLog</a>.
a comma-separated list of readings. You may use regular expressions in that list. If set, only updates of the listed readings create The attribute takes a comma-separated list of readings. You may use regular
events. expressions in that list. If set, only updates of the listed readings
create events.
</li> </li>
<a name="event-on-change-reading"></a> <a name="event-on-change-reading"></a>
<li>event-on-change-reading<br> <li>event-on-change-reading<br>
The attribute takes a comma-separated list of readings. You may use regular expressions in that list. If set, only changes of the listed readings create events. In other words, if a reading listed here is updated with the new value The attribute takes a comma-separated list of readings. You may use regular
identical to the old value, no event is created. expressions in that list. If set, only changes of the listed readings
create events. In other words, if a reading listed here is updated with the
new value identical to the old value, no event is created.
</li><br> </li><br>
The precedence of event-on-update-reading and event-on-change-reading is as follows: The precedence of event-on-update-reading and event-on-change-reading is as
follows:
<ol> <ol>
<li>If both attributes are not set, any update of any reading of the device creates an event.</li> <li>If both attributes are not set, any update of any reading of the device
<li>If any of the attributes is set, no events occur for updates or changes of readings creates an event.</li>
not listed in any of the attributes.</li> <li>If any of the attributes is set, no events occur for updates or changes
<li>If a reading is listed in event-on-update-reading, an update of the reading creates an of readings not listed in any of the attributes.</li>
event no matter whether the reading is also listed in event-on-change-reading.</li> <li>If a reading is listed in event-on-update-reading, an update of the
reading creates an event no matter whether the reading is also listed
in event-on-change-reading.</li>
</ol> </ol>
</ul> </ul>
@ -369,6 +387,7 @@ A line ending with \ will be concatenated with the next one, so long lines
<code>attr weatherstation event-on-update-reading wind,temperature,humidity</code><br> <code>attr weatherstation event-on-update-reading wind,temperature,humidity</code><br>
<code>attr weatherstation event-on-change-reading israining</code><br> <code>attr weatherstation event-on-change-reading israining</code><br>
<code>attr weatherstation event-on-change-reading israining,state</code><br> <code>attr weatherstation event-on-change-reading israining,state</code><br>
<code>attr heating stateFormat Temp:measured-temp, Valve:actuator</code><br>
</ul> </ul>
<br> <br>
@ -1037,6 +1056,14 @@ A line ending with \ will be concatenated with the next one, so long lines
receiver are considered a duplicate. Default is 0.5 seconds. receiver are considered a duplicate. Default is 0.5 seconds.
</li><br> </li><br>
<a name="showInternalValues"></a>
<li>showInternalValues<br>
Show data used for internal computations. If the name of an internal
value, reading or attribute starts with dot (.), then it is normally
hidden, and will only be visible, if this attribute is set to 1.
The attribute is checked by the list command, by the FHEMWEB room
overview and by xmllist.
</li>
</ul> </ul>
</ul> </ul>

View File

@ -326,49 +326,67 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.</p>
</li> </li>
<br><br> <br><br>
<br>
Die folgenden Attribute werden bei Modulen verwendet, die standardisierte "readings" <a name="readingFnAttributes"></a>
Aktualisierung der fhem.pl benutzen. Informieren Sie sich in der Liste der <b>readingFnAttribute</b><br>
Modulattribute wenn Sie wissen m&ouml;chten ob dies unterst&uuml;tzt wird.<br><br> Die folgenden Attribute werden bei Modulen verwendet, die standardisierte
"readings" Aktualisierung der fhem.pl benutzen. Informieren Sie sich in der
Liste der Modulattribute wenn Sie wissen m&ouml;chten ob dies
unterst&uuml;tzt wird.<br><br>
<a name="stateFormat"></a>
<li>stateFormat<br>
&Auml;ndert den Ger&auml;testatus, dies ist z.Bsp. in der Ausgabe des list
Kommandos zu sehen, oder in der Raum&uumlbersicht von FHEMWEB. Falls
nicht gesetzt, dann wird das state Reading &uuml;bernommen. Sonst werden
alle W&ouml;rter im Wert des Attributes durch das entsprechende Reading des
Ger&auml;tes ersetzt (soweit vorhanden). Falls der Wert in {}
eingeschlossen ist, dann wird es als Perl Ausdruck ausgewertet. Die
Auswertung passiert bei jeder &Auml;nderung eines Readings.
</li>
<a name="event-on-update-reading"></a> <a name="event-on-update-reading"></a>
<li>event-on-update-reading<br> <li>event-on-update-reading<br>
Wenn nicht gesetzt, erzeugt jede Ver&auml;nderung eines "readings" ein Ereignis, If not set, every update of any reading creates an event, which e.g. is
welches z.B. von handled by <a href="#notify">notify</a> or <a href="#FileLog">FileLog</a>.
<a href="#notify"> The attribute takes a comma-separated list of readings. You may use regular
notify</a> oder expressions in that list. If set, only updates of the listed readings
<a href="FileLog"> create events.
FileLog</a> ber&uuml;cksichtigt wird. Wenn gesetzt erzeugen nur Aktualisierungen </li>
der eingetragenen "readings" ein Ereignis.
<a name="event-on-update-reading"></a>
<li>event-on-update-reading<br>
Wenn nicht gesetzt, erzeugt jede Ver&auml;nderung eines "readings" ein
Ereignis, welches z.B. von <a href="#notify">notify</a> oder<a
href="FileLog"> FileLog</a> ber&uuml;cksichtigt wird. Wenn gesetzt erzeugen
nur Aktualisierungen der eingetragenen "readings" ein Ereignis.
</li> </li>
<a name="event-on-change-reading"></a> <a name="event-on-change-reading"></a>
<li>event-on-change-reading<br> <li>event-on-change-reading<br>
Dieses Attribut enth&auml;lt eine durch Kommata getrennte Liste von "readings".
Wenn gesetzt, erzeugen nur Ver&auml;nderungen der gelisteten "readings" ein Dieses Attribut enth&auml;lt eine durch Kommata getrennte Liste von
Ereignis. Wenn die aktualiserten Werte der gelisteten "readings" identisch "readings". Wenn gesetzt, erzeugen nur Ver&auml;nderungen der gelisteten
sind, wird kein Ereignis generiert.</li><p> "readings" ein Ereignis. Wenn die aktualiserten Werte der gelisteten
Die unterschiedlichen Bedeutungen von "readings" identisch sind, wird kein Ereignis generiert.</li><p> Die
event-on-update-reading und event-on-change-reading sind folgende</span>: unterschiedlichen Bedeutungen von event-on-update-reading und
<ol> event-on-change-reading sind folgende</span>:
<li> <ul>
<p>Wenn <li>Wenn beide Attribute nicht gesetzt sind erzeugt jede Aktualisierung
beide Attribute nicht gesetzt sind erzeugt jede Aktualisierung eines jeden "readings" eines jeden "readings" eines Ger&auml;tes ein Ereignis.</li>
eines Ger&auml;tes ein Ereignis.</li> <li>Wenn eines der Attribute gesetzt ist, erzeugen nur Updates oder
<li> &auml;nderungen von "readings" die nicht in einem der Attribute gesetzt
Wenn eines der Attribute gesetzt ist, erzeugen nur Updates oder &auml;nderungen sind ein Ereignis.</li>
von "readings" die nicht in einem der Attribute gesetzt sind ein Ereignis.</li> <li>Wenn ein "reading" in event-on-update-reading aufgef&uuml;hrt ist,
<li> erzeugt eine Aktualisierung ein Ereignis unabh&auml;ngig ob das
Wenn ein "reading" in event-on-update-reading aufgef&uuml;hrt ist, erzeugt eine "reading" auch in event-on-change-reading aufgelistet ist.</li>
Aktualisierung ein Ereignis unabh&auml;ngig ob das "reading" auch in </ul>
event-on-change-reading aufgelistet ist.</li>
</ol>
</ul> </ul>
<br> <br>
Ger&auml;tespezifische Attribute sind in der Beschreibung zum jeweiligen Ger&auml;t Ger&auml;tespezifische Attribute sind in der Beschreibung zum jeweiligen
aufgef&uuml;hrt. Ger&auml;t aufgef&uuml;hrt.
<br> <br>
Beispiele: Beispiele:
@ -380,6 +398,7 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.</p>
<code>attr weatherstation event-on-update-reading wind,temperature,humidity</code><br> <code>attr weatherstation event-on-update-reading wind,temperature,humidity</code><br>
<code>attr weatherstation event-on-change-reading israining</code><br> <code>attr weatherstation event-on-change-reading israining</code><br>
<code>attr weatherstation event-on-change-reading israining,state</code><br> <code>attr weatherstation event-on-change-reading israining,state</code><br>
<code>attr heating stateFormat Temp:measured-temp, Valve:actuator</code><br>
</ul> </ul>
<br> <br>
@ -1068,25 +1087,34 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.</p>
<a name="verbose"></a> <a name="verbose"></a>
<li>verbose<br> <li>verbose<br>
Setzt den Wert f&uuml;r die H&auml;ufigkeit/Intensit&auml;t von Nachrichten. M&ouml;gliche Setzt den Wert f&uuml;r die H&auml;ufigkeit/Intensit&auml;t von
Werte sind: Nachrichten. M&ouml;gliche Werte sind:
<ul> <ul>
<li>0 - Server start/stop <li>0 - Server start/stop
</li><li>1 - Fehlermeldungen oder unbekannte Pakete </li><li>1 - Fehlermeldungen oder unbekannte Pakete
</li><li>2 - bedeutende Ereigbisse/Alarme. </li><li>2 - bedeutende Ereigbisse/Alarme.
</li><li>3 - ausgesendete Kommandos werden gelogged. </li><li>3 - ausgesendete Kommandos werden gelogged.
</li><li>4 - Sie sehen was von den einzelnen Ger&auml;ten empfangen wird. </li><li>4 - Sie sehen was von den einzelnen Ger&auml;ten empfangen wird.
</li><li>5 - Fehlersuche.</li> </li><li>5 - Fehlersuche.</li>
</ul> </ul>
Es wird der Wert 3 f&uuml;r den Normalgebrauch empfohlen. Es wird der Wert 3 f&uuml;r den Normalgebrauch empfohlen.
</li><br> </li><br>
<a name="dupTimeout"></a> <a name="dupTimeout"></a>
<li>dupTimeout<br> <li>dupTimeout<br>
Definert die Wartezeit, nach der 2 identische Ereignisse zweier Definert die Wartezeit, nach der 2 identische Ereignisse zweier
Empf&auml;nger als Duplikat angesehen werden. Voreingestellt sind 0,5 Sekunden.&nbsp; Empf&auml;nger als Duplikat angesehen werden. Voreingestellt sind 0,5
Sekunden.&nbsp;
</li><br> </li><br>
<a name="showInternalValues"></a>
<li>showInternalValues<br>
Attribute/Ger&auml;te-Eintraege/Readings die mit Punkt (.) anfangen
werden nicht angezeigt, es sei denn das globale Attribut
showInternalValues ist gesetzt. Diese Variable wird bei dem list und
xmllist Befehl, und bei der FHEMWEB Raumansicht gepr&uuml;ft.
</li>
</ul> </ul>
</ul> </ul>