diff --git a/fhem/FHEM/00_MQTT.pm b/fhem/FHEM/00_MQTT.pm index c7bbffd3a..539c9e4bc 100644 --- a/fhem/FHEM/00_MQTT.pm +++ b/fhem/FHEM/00_MQTT.pm @@ -518,45 +518,37 @@ sub client_stop($) {
connects fhem to mqtt.
+A single MQTT device can serve multiple MQTT_DEVICE and MQTT_BRIDGE clients.
+ Each MQTT_DEVICE acts as a bridge in between an fhem-device and mqtt.
+ Note: this module is based on module Net::MQTT.
define <name> MQTT <ip:port>
set <name> connect
set <name> disconnect
Define
+define <name> MQTT <ip:port>
Specifies the MQTT device.
+Set
+set <name> connect
+ (re-)connects the MQTT-device to the mqtt-broker
set <name> disconnect
+ disconnects the MQTT-device from the mqtt-broker
Attributes
+keep-alive
+ sets the keep-alive time (in seconds).
acts as a bridge in between an fhem-device and mqtt-topics.
+requires a MQTT-device as IODev
+ Note: this module is based on module Net::MQTT.
define <name> MQTT_BRIDGE <fhem-device-name>
get <name> readings
attr <name> subscribeSet <topic>
attr <name> subscribeSet_<reading> <topic>
attr <name> publishState <topic>
attr <name> publishReading_<reading> <topic>
attr <name> publish-topic-base <topic>
Define
+define <name> MQTT_BRIDGE <fhem-device-name>
Specifies the MQTT device.
+ <fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.
Get
+get <name> readings
+ retrieves all existing readings from fhem-device and configures (default-)topics for them.
+ attribute 'publish-topic-base' is prepended if set.
Attributes
+attr <name> subscribeSet <topic>
+ configures a topic that will issue a 'set <message> whenever a message is received
attr <name> subscribeSet_<reading> <topic>
+ configures a topic that will issue a 'set <reading> <message> whenever a message is received
attr <name> publishState <topic>
+ configures a topic such that a message is sent to topic whenever the device state changes.
attr <name> publishReading_<reading> <topic>
+ configures a topic such that a message is sent to topic whenever the device readings value changes.
attr <name> publish-topic-base <topic>
+ this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings
acts as a fhem-device that is mapped to mqtt-topics.
+requires a MQTT-device as IODev
+ Note: this module is based on module Net::MQTT.
define <name> MQTT_DEVICE
set <name> <command>
set <name> <h;reading> <value>
attr <name> publishSet [<commands>] <topic>
attr <name> publishSet_<reading> [<values>] <topic>
attr <name> autoSubscribeReadings <topic>
attr <name> subscribeReading_<reading> <topic>
Define
+define <name> MQTT_DEVICE
+ Specifies the MQTT device.
Set
+set <name> <command>
+ sets reading 'state' and publishes the command to topic configured via attr publishSet
set <name> <h;reading> <value>
+ sets reading <h;reading> and publishes the command to topic configured via attr publishSet_<h;reading>
Attributes
+attr <name> publishSet [<commands>] <topic>
+ configures set commands that may be used to both set reading 'state' and publish to configured topic
attr <name> publishSet_<reading> [<values>] <topic>
+ configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic
attr <name> autoSubscribeReadings <topic>
+ specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match
+ e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'
attr <name> subscribeReading_<reading> <topic>
+ mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives