mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
MQTT: dokumentation
git-svn-id: https://svn.fhem.de/fhem/trunk@6720 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d31500cab7
commit
440bac9efa
@ -518,45 +518,37 @@ sub client_stop($) {
|
|||||||
<a name="MQTT"></a>
|
<a name="MQTT"></a>
|
||||||
<h3>MQTT</h3>
|
<h3>MQTT</h3>
|
||||||
<ul>
|
<ul>
|
||||||
connects fhem to <a href="http://mqtt.org">mqtt</a>
|
<p>connects fhem to <a href="http://mqtt.org">mqtt</a>.</p>
|
||||||
<br><br>
|
<p>A single MQTT device can serve multiple <a href="#MQTT_DEVICE">MQTT_DEVICE</a> and <a href="#MQTT_BRIDGE">MQTT_BRIDGE</a> clients.<br/>
|
||||||
A single MQTT device can serve multiple <a href="#MQTT_DEVICE">MQTT_DEVICE</a> clients.<br><br>
|
Each <a href="#MQTT_DEVICE">MQTT_DEVICE</a> acts as a bridge in between an fhem-device and mqtt.<br/>
|
||||||
|
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.</p>
|
||||||
Each <a href="#MQTT_DEVICE">MQTT_DEVICE</a> acts as a bridge in between an fhem-device and mqtt.
|
|
||||||
|
|
||||||
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<a name="MQTTdefine"></a>
|
<a name="MQTTdefine"></a>
|
||||||
<b>Define</b><br>
|
<p><b>Define</b></p>
|
||||||
<ul><br>
|
<ul>
|
||||||
<code>define <name> MQTT <ip:port></code> <br>
|
<p><code>define <name> MQTT <ip:port></code></p>
|
||||||
Specifies the MQTT device.<br>
|
<p>Specifies the MQTT device.</p>
|
||||||
<br>
|
</ul>
|
||||||
<br>
|
<a name="MQTTset"></a>
|
||||||
<a name="MQTTset"></a>
|
<p><b>Set</b></p>
|
||||||
<b>Set</b>
|
<ul>
|
||||||
<ul>
|
<li>
|
||||||
<li>
|
<p><code>set <name> connect</code><br/>
|
||||||
<code>set <name> connect</code><br>
|
(re-)connects the MQTT-device to the mqtt-broker</p>
|
||||||
(re-)connects the MQTT-device to the mqtt-broker
|
</li>
|
||||||
</li><br>
|
<li>
|
||||||
<li>
|
<p><code>set <name> disconnect</code><br/>
|
||||||
<code>set <name> disconnect</code><br>
|
disconnects the MQTT-device from the mqtt-broker</p>
|
||||||
disconnects the MQTT-device from the mqtt-broker
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
<a name="MQTTattr"></a>
|
||||||
<br><br>
|
<p><b>Attributes</b></p>
|
||||||
<a name="MQTTattr"></a>
|
<ul>
|
||||||
<b>Attributes</b><br>
|
<li>
|
||||||
<ul>
|
<p>keep-alive<br/>
|
||||||
<li>keep-alive<br>
|
sets the keep-alive time (in seconds).</p>
|
||||||
sets the keep-alive time (in seconds).
|
</li>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
|
||||||
|
|
||||||
=end html
|
=end html
|
||||||
=cut
|
=cut
|
||||||
|
@ -187,58 +187,50 @@ sub onmessage($$$) {
|
|||||||
<a name="MQTT_BRIDGE"></a>
|
<a name="MQTT_BRIDGE"></a>
|
||||||
<h3>MQTT_BRIDGE</h3>
|
<h3>MQTT_BRIDGE</h3>
|
||||||
<ul>
|
<ul>
|
||||||
acts as a bridge in between an fhem-device and <a href="http://mqtt.org">mqtt</a>-topics.
|
<p>acts as a bridge in between an fhem-device and <a href="http://mqtt.org/">mqtt</a>-topics.</p>
|
||||||
<br><br>
|
<p>requires a <a href="#MQTT">MQTT</a>-device as IODev<br/>
|
||||||
requires a <a href="#MQTT">MQTT</a>-device as IODev<br><br>
|
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.</p>
|
||||||
|
|
||||||
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<a name="MQTT_BRIDGEdefine"></a>
|
<a name="MQTT_BRIDGEdefine"></a>
|
||||||
<b>Define</b><br>
|
<p><b>Define</b></p>
|
||||||
<ul><br>
|
<ul>
|
||||||
<code>define <name> MQTT_BRIDGE <fhem-device-name></code> <br>
|
<p><code>define <name> MQTT_BRIDGE <fhem-device-name></code></p>
|
||||||
Specifies the MQTT device.<br>
|
<p>Specifies the MQTT device.<br/>
|
||||||
<fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.<br>
|
<fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.</p>
|
||||||
<br>
|
</ul>
|
||||||
<a name="MQTT_BRIDGEget"></a>
|
<a name="MQTT_BRIDGEget"></a>
|
||||||
<b>Get</b>
|
<p><b>Get</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code>get <name> readings</code><br>
|
<p><code>get <name> readings</code><br/>
|
||||||
retrieves all existing readings from fhem-device and configures (default-)topics for them.<br>
|
retrieves all existing readings from fhem-device and configures (default-)topics for them.<br/>
|
||||||
attribute 'publish-topic-base' is prepended if set.
|
attribute 'publish-topic-base' is prepended if set.</p>
|
||||||
</li><br>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<a name="MQTT_BRIDGEattr"></a>
|
||||||
|
<p><b>Attributes</b></p>
|
||||||
<a name="MQTT_BRIDGEattr"></a>
|
<ul>
|
||||||
<b>Attributes</b><br>
|
<li>
|
||||||
<ul>
|
<p><code>attr <name> subscribeSet <topic></code><br/>
|
||||||
<li>
|
configures a topic that will issue a 'set <message> whenever a message is received</p>
|
||||||
<code>attr <name> subscribeSet <topic></code><br>
|
</li>
|
||||||
configures a topic that will issue a 'set <message> whenever a message is received<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> subscribeSet_<reading> <topic></code><br/>
|
||||||
<li>
|
configures a topic that will issue a 'set <reading> <message> whenever a message is received</p>
|
||||||
<code>attr <name> subscribeSet_<reading> <topic></code><br>
|
</li>
|
||||||
configures a topic that will issue a 'set <reading> <message> whenever a message is received<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> publishState <topic></code><br/>
|
||||||
<li>
|
configures a topic such that a message is sent to topic whenever the device state changes.</p>
|
||||||
<code>attr <name> publishState <topic></code><br>
|
</li>
|
||||||
configures a topic such that a message is sent to topic whenever the device state changes.<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> publishReading_<reading> <topic></code><br/>
|
||||||
<li>
|
configures a topic such that a message is sent to topic whenever the device readings value changes.</p>
|
||||||
<code>attr <name> publishReading_<reading> <topic></code><br>
|
</li>
|
||||||
configures a topic such that a message is sent to topic whenever the device readings value changes.<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> publish-topic-base <topic></code><br/>
|
||||||
<li>
|
this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings</p>
|
||||||
<code>attr <name> publish-topic-base <topic></code><br>
|
</li>
|
||||||
this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings<br>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
|
||||||
|
|
||||||
=end html
|
=end html
|
||||||
=cut
|
=cut
|
||||||
|
@ -191,57 +191,49 @@ sub onmessage($$$) {
|
|||||||
<a name="MQTT_DEVICE"></a>
|
<a name="MQTT_DEVICE"></a>
|
||||||
<h3>MQTT_DEVICE</h3>
|
<h3>MQTT_DEVICE</h3>
|
||||||
<ul>
|
<ul>
|
||||||
acts as a fhem-device that is mapped to <a href="http://mqtt.org">mqtt</a>-topics.
|
<p>acts as a fhem-device that is mapped to <a href="http://mqtt.org/">mqtt</a>-topics.</p>
|
||||||
<br><br>
|
<p>requires a <a href="#MQTT">MQTT</a>-device as IODev<br/>
|
||||||
requires a <a href="#MQTT">MQTT</a>-device as IODev<br><br>
|
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.</p>
|
||||||
|
|
||||||
Note: this module is based on module <a href="https://metacpan.org/pod/distribution/Net-MQTT/lib/Net/MQTT.pod">Net::MQTT</a>.
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<a name="MQTT_DEVICEdefine"></a>
|
<a name="MQTT_DEVICEdefine"></a>
|
||||||
<b>Define</b><br>
|
<p><b>Define</b></p>
|
||||||
<ul><br>
|
<ul>
|
||||||
<code>define <name> MQTT_DEVICE</code> <br>
|
<p><code>define <name> MQTT_DEVICE</code><br/>
|
||||||
Specifies the MQTT device.<br>
|
Specifies the MQTT device.</p>
|
||||||
<br>
|
</ul>
|
||||||
<a name="MQTT_DEVICEset"></a>
|
<a name="MQTT_DEVICEset"></a>
|
||||||
<b>Set</b>
|
<p><b>Set</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code>set <name> <command></code><br>
|
<p><code>set <name> <command></code><br/>
|
||||||
sets reading 'state' and publishes the command to topic configured via attr publishSet
|
sets reading 'state' and publishes the command to topic configured via attr publishSet</p>
|
||||||
</li><br>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>set <name> <h;reading> <value></code><br>
|
<p><code>set <name> <h;reading> <value></code><br/>
|
||||||
sets reading <h;reading> and publishes the command to topic configured via attr publishSet_<h;reading>
|
sets reading <h;reading> and publishes the command to topic configured via attr publishSet_<h;reading></p>
|
||||||
</li><br>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<a name="MQTT_DEVICEattr"></a>
|
||||||
|
<p><b>Attributes</b></p>
|
||||||
<a name="MQTT_DEVICEattr"></a>
|
<ul>
|
||||||
<b>Attributes</b><br>
|
<li>
|
||||||
<ul>
|
<p><code>attr <name> publishSet [<commands>] <topic></code><br/>
|
||||||
<li>
|
configures set commands that may be used to both set reading 'state' and publish to configured topic</p>
|
||||||
<code>attr <name> publishSet [<commands>] <topic></code><br>
|
</li>
|
||||||
configures set commands that may be used to both set reading 'state' and publish to configured topic<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> publishSet_<reading> [<values>] <topic></code><br/>
|
||||||
<li>
|
configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic</p>
|
||||||
<code>attr <name> publishSet_<reading> [<values>] <topic></code><br>
|
</li>
|
||||||
configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic<br>
|
<li>
|
||||||
</li>
|
<p><code>attr <name> autoSubscribeReadings <topic></code><br/>
|
||||||
<li>
|
specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match<br/>
|
||||||
<code>attr <name> autoSubscribeReadings <topic></code><br>
|
e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'</p>
|
||||||
specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match<br>
|
</li>
|
||||||
e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'
|
<li>
|
||||||
</li>
|
<p><code>attr <name> subscribeReading_<reading> <topic></code><br/>
|
||||||
<li>
|
mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives</p>
|
||||||
<code>attr <name> subscribeReading_<reading> <topic></code><br>
|
</li>
|
||||||
mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives<br>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
|
||||||
|
|
||||||
=end html
|
=end html
|
||||||
=cut
|
=cut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user