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>
|
||||
<h3>MQTT</h3>
|
||||
<ul>
|
||||
connects fhem to <a href="http://mqtt.org">mqtt</a>
|
||||
<br><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.
|
||||
|
||||
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>
|
||||
|
||||
<p>connects fhem to <a href="http://mqtt.org">mqtt</a>.</p>
|
||||
<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/>
|
||||
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>
|
||||
<a name="MQTTdefine"></a>
|
||||
<b>Define</b><br>
|
||||
<ul><br>
|
||||
<code>define <name> MQTT <ip:port></code> <br>
|
||||
Specifies the MQTT device.<br>
|
||||
<br>
|
||||
<br>
|
||||
<p><b>Define</b></p>
|
||||
<ul>
|
||||
<p><code>define <name> MQTT <ip:port></code></p>
|
||||
<p>Specifies the MQTT device.</p>
|
||||
</ul>
|
||||
<a name="MQTTset"></a>
|
||||
<b>Set</b>
|
||||
<p><b>Set</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>set <name> connect</code><br>
|
||||
(re-)connects the MQTT-device to the mqtt-broker
|
||||
</li><br>
|
||||
<p><code>set <name> connect</code><br/>
|
||||
(re-)connects the MQTT-device to the mqtt-broker</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>set <name> disconnect</code><br>
|
||||
disconnects the MQTT-device from the mqtt-broker
|
||||
<p><code>set <name> disconnect</code><br/>
|
||||
disconnects the MQTT-device from the mqtt-broker</p>
|
||||
</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
<a name="MQTTattr"></a>
|
||||
<b>Attributes</b><br>
|
||||
<p><b>Attributes</b></p>
|
||||
<ul>
|
||||
<li>keep-alive<br>
|
||||
sets the keep-alive time (in seconds).
|
||||
<li>
|
||||
<p>keep-alive<br/>
|
||||
sets the keep-alive time (in seconds).</p>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
=cut
|
||||
|
@ -187,58 +187,50 @@ sub onmessage($$$) {
|
||||
<a name="MQTT_BRIDGE"></a>
|
||||
<h3>MQTT_BRIDGE</h3>
|
||||
<ul>
|
||||
acts as a bridge in between an fhem-device and <a href="http://mqtt.org">mqtt</a>-topics.
|
||||
<br><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>.
|
||||
<br><br>
|
||||
|
||||
<p>acts as a bridge in between an fhem-device and <a href="http://mqtt.org/">mqtt</a>-topics.</p>
|
||||
<p>requires a <a href="#MQTT">MQTT</a>-device as IODev<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>
|
||||
<a name="MQTT_BRIDGEdefine"></a>
|
||||
<b>Define</b><br>
|
||||
<ul><br>
|
||||
<code>define <name> MQTT_BRIDGE <fhem-device-name></code> <br>
|
||||
Specifies the MQTT device.<br>
|
||||
<fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.<br>
|
||||
<br>
|
||||
<p><b>Define</b></p>
|
||||
<ul>
|
||||
<p><code>define <name> MQTT_BRIDGE <fhem-device-name></code></p>
|
||||
<p>Specifies the MQTT device.<br/>
|
||||
<fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.</p>
|
||||
</ul>
|
||||
<a name="MQTT_BRIDGEget"></a>
|
||||
<b>Get</b>
|
||||
<p><b>Get</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>get <name> readings</code><br>
|
||||
retrieves all existing readings from fhem-device and configures (default-)topics for them.<br>
|
||||
attribute 'publish-topic-base' is prepended if set.
|
||||
</li><br>
|
||||
<p><code>get <name> readings</code><br/>
|
||||
retrieves all existing readings from fhem-device and configures (default-)topics for them.<br/>
|
||||
attribute 'publish-topic-base' is prepended if set.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<a name="MQTT_BRIDGEattr"></a>
|
||||
<b>Attributes</b><br>
|
||||
<p><b>Attributes</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>attr <name> subscribeSet <topic></code><br>
|
||||
configures a topic that will issue a 'set <message> whenever a message is received<br>
|
||||
<p><code>attr <name> subscribeSet <topic></code><br/>
|
||||
configures a topic that will issue a 'set <message> whenever a message is received</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> subscribeSet_<reading> <topic></code><br>
|
||||
configures a topic that will issue a 'set <reading> <message> whenever a message is received<br>
|
||||
<p><code>attr <name> subscribeSet_<reading> <topic></code><br/>
|
||||
configures a topic that will issue a 'set <reading> <message> whenever a message is received</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> publishState <topic></code><br>
|
||||
configures a topic such that a message is sent to topic whenever the device state changes.<br>
|
||||
<p><code>attr <name> publishState <topic></code><br/>
|
||||
configures a topic such that a message is sent to topic whenever the device state changes.</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> publishReading_<reading> <topic></code><br>
|
||||
configures a topic such that a message is sent to topic whenever the device readings value changes.<br>
|
||||
<p><code>attr <name> publishReading_<reading> <topic></code><br/>
|
||||
configures a topic such that a message is sent to topic whenever the device readings value changes.</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> publish-topic-base <topic></code><br>
|
||||
this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings<br>
|
||||
<p><code>attr <name> publish-topic-base <topic></code><br/>
|
||||
this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings</p>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
=cut
|
||||
|
@ -191,57 +191,49 @@ sub onmessage($$$) {
|
||||
<a name="MQTT_DEVICE"></a>
|
||||
<h3>MQTT_DEVICE</h3>
|
||||
<ul>
|
||||
acts as a fhem-device that is mapped to <a href="http://mqtt.org">mqtt</a>-topics.
|
||||
<br><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>.
|
||||
<br><br>
|
||||
|
||||
<p>acts as a fhem-device that is mapped to <a href="http://mqtt.org/">mqtt</a>-topics.</p>
|
||||
<p>requires a <a href="#MQTT">MQTT</a>-device as IODev<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>
|
||||
<a name="MQTT_DEVICEdefine"></a>
|
||||
<b>Define</b><br>
|
||||
<ul><br>
|
||||
<code>define <name> MQTT_DEVICE</code> <br>
|
||||
Specifies the MQTT device.<br>
|
||||
<br>
|
||||
<p><b>Define</b></p>
|
||||
<ul>
|
||||
<p><code>define <name> MQTT_DEVICE</code><br/>
|
||||
Specifies the MQTT device.</p>
|
||||
</ul>
|
||||
<a name="MQTT_DEVICEset"></a>
|
||||
<b>Set</b>
|
||||
<p><b>Set</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>set <name> <command></code><br>
|
||||
sets reading 'state' and publishes the command to topic configured via attr publishSet
|
||||
</li><br>
|
||||
<p><code>set <name> <command></code><br/>
|
||||
sets reading 'state' and publishes the command to topic configured via attr publishSet</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>set <name> <h;reading> <value></code><br>
|
||||
sets reading <h;reading> and publishes the command to topic configured via attr publishSet_<h;reading>
|
||||
</li><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></p>
|
||||
</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<a name="MQTT_DEVICEattr"></a>
|
||||
<b>Attributes</b><br>
|
||||
<p><b>Attributes</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>attr <name> publishSet [<commands>] <topic></code><br>
|
||||
configures set commands that may be used to both set reading 'state' and publish to configured topic<br>
|
||||
<p><code>attr <name> publishSet [<commands>] <topic></code><br/>
|
||||
configures set commands that may be used to both set reading 'state' and publish to configured topic</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> publishSet_<reading> [<values>] <topic></code><br>
|
||||
configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic<br>
|
||||
<p><code>attr <name> publishSet_<reading> [<values>] <topic></code><br/>
|
||||
configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> autoSubscribeReadings <topic></code><br>
|
||||
specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match<br>
|
||||
e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'
|
||||
<p><code>attr <name> autoSubscribeReadings <topic></code><br/>
|
||||
specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match<br/>
|
||||
e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'</p>
|
||||
</li>
|
||||
<li>
|
||||
<code>attr <name> subscribeReading_<reading> <topic></code><br>
|
||||
mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives<br>
|
||||
<p><code>attr <name> subscribeReading_<reading> <topic></code><br/>
|
||||
mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives</p>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
=end html
|
||||
=cut
|
||||
|
Loading…
x
Reference in New Issue
Block a user