MQTT
Description
Section titled “Description”The mqtt.Source and mqtt.Sink node types provide source and sink nodes which receive published messages from an MQTT topic and publish messages to an MQTT topic respectively.
Properties
Section titled “Properties”The mqtt.Source and mqtt.Sink node types expect the following properties:
-
host: Required. String. Hostname to connect to. Defaults to127.0.0.1. -
port: Required. Integer. Port to connect to. Defaults to the standard MQTT port, 1883. -
username: Optional. String. Connection username. Defaults to environment variableMQTT_USERNAMEif not specified. -
password: Optional. String. Connection password. Defaults to environment variableMQTT_PASSWORDif not specified. -
topic: Required. String. The MQTT topic to subscribe to or publish on. -
qos: Required. Integer. Defaults to 1. The MQTT QoS level to use.
MQTT_ARGS = dict(host='127.0.0.1')
@maindef graph(): return ( mqtt.Source(**MQTT_ARGS) | ... | mqtt.Sink(**MQTT_ARGS) )