<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>http://wiki.fhem.de/w/index.php?action=history&amp;feed=atom&amp;title=ReadingsProxy</id>
	<title>ReadingsProxy - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.fhem.de/w/index.php?action=history&amp;feed=atom&amp;title=ReadingsProxy"/>
	<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;action=history"/>
	<updated>2026-05-05T12:29:24Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in FHEMWiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29448&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29448&amp;oldid=prev"/>
		<updated>2019-02-07T19:14:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:14 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;Zeile 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Noch einmal zusammengefasst. Legt man valueFn und setFn wie oben beschrieben fest, so hat man&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; set &amp;lt;Proxy-device&amp;gt; on             ===&amp;gt;    set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;lt;MQTT-device&amp;gt;:myswitch1 = &quot;on&quot;    ===&amp;gt;    &amp;lt;Proxy-device&amp;gt;:state = &quot;on&quot;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l51&quot;&gt;Zeile 51:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on. Wieder können die Variablen $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts) und $READING (der Name des betreffenden Readings) sowie $VALUE (Wert des Readings) verwendet werden.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on. Wieder können die Variablen $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts) und $READING (der Name des betreffenden Readings) sowie $VALUE (Wert des Readings) verwendet werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Noch einmal zusammengefasst. Legt man valueFn und setFn wie oben beschrieben fest, so hat man&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; set &amp;lt;Proxy-device&amp;gt; on             ===&amp;gt;    set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;lt;MQTT-device&amp;gt;:myswitch1 = &quot;on&quot;    ===&amp;gt;    &amp;lt;Proxy-device&amp;gt;:state = &quot;on&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29447:rev-29448:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29447&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29447&amp;oldid=prev"/>
		<updated>2019-02-07T19:14:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:14 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Zeile 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Noch einmal zusammengefasst&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Noch einmal zusammengefasst&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Legt man valueFn und setFn wie oben beschrieben fest, so hat man&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  set &amp;lt;Proxy-device&amp;gt; on             ===&amp;gt;    set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  set &amp;lt;Proxy-device&amp;gt; on             ===&amp;gt;    set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;MQTT-device&amp;gt;:myswitch1 = &amp;quot;on&amp;quot;    ===&amp;gt;    &amp;lt;Proxy-device&amp;gt;:state = &amp;quot;on&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;MQTT-device&amp;gt;:myswitch1 = &amp;quot;on&amp;quot;    ===&amp;gt;    &amp;lt;Proxy-device&amp;gt;:state = &amp;quot;on&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29446:rev-29447:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29446&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29446&amp;oldid=prev"/>
		<updated>2019-02-07T19:12:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:12 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;Zeile 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (der Name des parent-Geräts), $READING (der Name des betreffenden Reading), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Noch einmal zusammengefasst:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; set &amp;lt;Proxy-device&amp;gt; on             ===&amp;gt;    set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;lt;MQTT-device&amp;gt;:myswitch1 = &quot;on&quot;    ===&amp;gt;    &amp;lt;Proxy-device&amp;gt;:state = &quot;on&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29445:rev-29446:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29445&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29445&amp;oldid=prev"/>
		<updated>2019-02-07T19:06:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:06 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot;&gt;Zeile 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Damit set-Befehle übergeben werden, wird nun setFn wie folgt festgelegt&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Damit set-Befehle übergeben werden, wird nun setFn wie folgt festgelegt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das &lt;/del&gt;parent-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Gerät&lt;/del&gt;), $READING (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das betreffende &lt;/del&gt;Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &quot;on&quot; lautete (genauer &#039;&#039;set &amp;lt;Proxy-device&amp;gt; on&#039;&#039;), dann wird &#039;&#039;switch1 on&#039;&#039; an das MQTT-Gerät übergeben und es wird damit &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&#039;&#039; aufgerufen. War der Befehl nicht on, wird &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&#039;&#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;der Name des &lt;/ins&gt;parent-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Geräts&lt;/ins&gt;), $READING (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;der Name des betreffenden &lt;/ins&gt;Reading&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;), wahrscheinlich auch $VALUE (der Wert des betreffenden Readings&lt;/ins&gt;) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &quot;on&quot; lautete (genauer &#039;&#039;set &amp;lt;Proxy-device&amp;gt; on&#039;&#039;), dann wird &#039;&#039;switch1 on&#039;&#039; an das MQTT-Gerät übergeben und es wird damit &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&#039;&#039; aufgerufen. War der Befehl nicht on, wird &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&#039;&#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot;&gt;Zeile 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;valueFn bestimmt, wie sich das Reading state des Readingsproxy berechnet. Ist dieses Attribut nicht gesetzt, so ändert sich das Reading nicht. Ist das Attribut definiert, so sollte es sich um eine Perl-Funktion handeln (d.h. eingerahmt in geschweifte Klammern), die dann definiert, wie sich state ermittelt. Im folgenden Fall&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;valueFn bestimmt, wie sich das Reading state des Readingsproxy berechnet. Ist dieses Attribut nicht gesetzt, so ändert sich das Reading nicht. Ist das Attribut definiert, so sollte es sich um eine Perl-Funktion handeln (d.h. eingerahmt in geschweifte Klammern), die dann definiert, wie sich state ermittelt. Im folgenden Fall&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on. Wieder können die Variablen $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das &lt;/del&gt;parent-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Gerät&lt;/del&gt;) und $READING (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das betreffende Reading&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on. Wieder können die Variablen $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;der Name des &lt;/ins&gt;parent-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Geräts&lt;/ins&gt;) und $READING (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;der Name des betreffenden Readings) sowie $VALUE (Wert des Readings&lt;/ins&gt;) verwendet werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;verwendet werden.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29444:rev-29445:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29444&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29444&amp;oldid=prev"/>
		<updated>2019-02-07T19:04:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:04 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot;&gt;Zeile 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;valueFn bestimmt, wie sich das Reading state des Readingsproxy berechnet. Ist dieses Attribut nicht gesetzt, so ändert sich das Reading nicht. Ist das Attribut definiert, so sollte es sich um eine Perl-Funktion handeln (d.h. eingerahmt in geschweifte Klammern), die dann definiert, wie sich state ermittelt. Im folgenden Fall&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;valueFn bestimmt, wie sich das Reading state des Readingsproxy berechnet. Ist dieses Attribut nicht gesetzt, so ändert sich das Reading nicht. Ist das Attribut definiert, so sollte es sich um eine Perl-Funktion handeln (d.h. eingerahmt in geschweifte Klammern), die dann definiert, wie sich state ermittelt. Im folgenden Fall&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&amp;quot;off&amp;quot;:&amp;quot;on&amp;quot;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist. In allen anderen Fällen ist der Zustand state gleich on&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Wieder können die Variablen $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät) und $READING (das betreffende Reading)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;verwendet werden&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29443:rev-29444:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29443&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29443&amp;oldid=prev"/>
		<updated>2019-02-07T19:03:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;Zeile 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;getFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29442:rev-29443:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29442&amp;oldid=prev</id>
		<title>Andies: /* Attribute */ valueFn</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29442&amp;oldid=prev"/>
		<updated>2019-02-07T19:03:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute: &lt;/span&gt; valueFn&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot;&gt;Zeile 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;valueFn bestimmt, wie sich das Reading state des Readingsproxy berechnet. Ist dieses Attribut nicht gesetzt, so ändert sich das Reading nicht. Ist das Attribut definiert, so sollte es sich um eine Perl-Funktion handeln (d.h. eingerahmt in geschweifte Klammern), die dann definiert, wie sich state ermittelt. Im folgenden Fall&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; attr &amp;lt;Proxy-device&amp;gt; valueFn {($VALUE == 0)?&quot;off&quot;&lt;/ins&gt;:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;on&quot;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ist das Reading state gleich off, wenn der Wert des parent Devices (auf das sich readingProxy bezieht) gleich null ist&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In allen anderen Fällen ist der Zustand state gleich on&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Anwendungsbeispiele ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29441:rev-29442:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29441&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29441&amp;oldid=prev"/>
		<updated>2019-02-07T19:00:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 21:00 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot;&gt;Zeile 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Attribute mit spezieller Bedeutung für Proxy Devices:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Attribute mit spezieller Bedeutung für Proxy Devices:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;readingFnAttributes&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;readingFnAttributes&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:...&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;getFn&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;setFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;setFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l41&quot;&gt;Zeile 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &amp;quot;on&amp;quot; lautete (genauer &amp;#039;&amp;#039;set &amp;lt;Proxy-device&amp;gt; on&amp;#039;&amp;#039;), dann wird &amp;#039;&amp;#039;switch1 on&amp;#039;&amp;#039; an das MQTT-Gerät übergeben und es wird damit &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&amp;#039;&amp;#039; aufgerufen. War der Befehl nicht on, wird &amp;#039;&amp;#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&amp;#039;&amp;#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;getFn&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Hier gilt das oben für setFn gesagte, nur dass es sich in diesem Fall nicht um einen set-Befehl, sondern einen get-Befehl handelt.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29438&amp;oldid=prev</id>
		<title>Andies: /* Attribute */</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29438&amp;oldid=prev"/>
		<updated>2019-02-07T18:53:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 20:53 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Zeile 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Damit set-Befehle übergeben werden, wird nun setFn wie folgt festgelegt&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Damit set-Befehle übergeben werden, wird nun setFn wie folgt festgelegt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &amp;quot;on&amp;quot;)?&amp;quot;switch1 on&amp;quot;:&amp;quot;switch1 off&amp;quot;}  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &quot;on&quot; lautete (genauer &#039;&#039;set &amp;lt;Proxy-device&amp;gt; on&#039;&#039;), dann wird &#039;&#039;switch1 on&#039;&#039; an das MQTT-Gerät übergeben und es wird damit &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&#039;&#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn das Kommando &quot;on&quot; lautete (genauer &#039;&#039;set &amp;lt;Proxy-device&amp;gt; on&#039;&#039;), dann wird &#039;&#039;switch1 on&#039;&#039; an das MQTT-Gerät übergeben und es wird damit &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039; aufgerufen. War der Befehl nicht on, wird &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 off&lt;/ins&gt;&#039;&#039; aufgerufen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
	<entry>
		<id>http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29437&amp;oldid=prev</id>
		<title>Andies: /* Attribute */  setFn erklärt</title>
		<link rel="alternate" type="text/html" href="http://wiki.fhem.de/w/index.php?title=ReadingsProxy&amp;diff=29437&amp;oldid=prev"/>
		<updated>2019-02-07T18:53:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Attribute: &lt;/span&gt;  setFn erklärt&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 7. Februar 2019, 20:53 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot;&gt;Zeile 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;setFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;setFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;setFn &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;führt die Übergabe eines &lt;/del&gt;set-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Befehls &lt;/del&gt;an das übergeordnete Gerät &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;durch. Hier handelt es sich typischerweise um einen Perl-Ausdruck. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das &lt;/del&gt;parent&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-Gerät&lt;/del&gt;), &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$READING (das betreffende Reading) and $ARGS (unklar)&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;setFn &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mit setFn können &lt;/ins&gt;set-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Befehl &lt;/ins&gt;an das übergeordnete Gerät (parent &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;device&lt;/ins&gt;) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;durchgereicht werden. setFn ist ein Attribut&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;es muss aber eine Funktion übergeben werden. Dazu wird am besten ein Beispiel präsentiert&lt;/ins&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Argument von setFn ist der Set&lt;/del&gt;-Befehl des &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ReadingProxy&lt;/del&gt;, das &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ergebnis von setFn &lt;/del&gt;wird an das &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;übergeordnete &lt;/del&gt;Gerät übergeben.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parent device &amp;lt;MQTT device&amp;gt; sei ein MQTT-Gerät, bei dem ein set&lt;/ins&gt;-Befehl &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zum ein- oder ausschalten wie folgt lautet&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; set  &amp;lt;MQTT-device&amp;gt; switch1 on/off.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Der Zustand &lt;/ins&gt;des &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Schalters wird im Reading myswitch1 wiedergegeben. Dann kann man ein ReadingsProxy definieren&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dass auf dieses Reading Bezug nimmt&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; defmod &amp;lt;Proxy-device&amp;gt; readingsProxy &amp;lt;MQTT-device&amp;gt;:myswitch1&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Damit set-Befehle übergeben werden, wird nun setFn wie folgt festgelegt&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; attr &amp;lt;Proxy-device&amp;gt; setFn {($CMD eq &quot;on&quot;)?&quot;switch1 on&quot;:&quot;switch1 off&quot;} &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zuerst einmal handelt es sich um einen Perl-Ausdruck, was man an den geschweiften Klammern erkennt. Weiter erkennt man eine Funktion, die Eingaben wie die Variable $CMD besitzt und in Abhängigkeit von dieser Eingabe einen Rückgabe (direkt an MQTT-device) geben wird. Verwendet werden können die folgenden Variablen: $CMD (das vom Proxy ausgelöste set-Kommando), $DEVICE (das parent-Gerät), $READING (das betreffende Reading) and $ARGS (unklar). Der oben stehende Befehl ist eine if-then-else Abfrage: Wenn &lt;/ins&gt;das &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Kommando &quot;on&quot; lautete (genauer &#039;&#039;set &amp;lt;Proxy-device&amp;gt; on&#039;&#039;), dann &lt;/ins&gt;wird &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;switch1 on&#039;&#039; &lt;/ins&gt;an das &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;MQTT-&lt;/ins&gt;Gerät übergeben &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;und es wird damit &#039;&#039;set &amp;lt;MQTT-device&amp;gt; switch1 on&#039;&#039; aufgerufen&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;valueFn&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1fhemwiki:diff:1.41:old-29436:rev-29437:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Andies</name></author>
	</entry>
</feed>