Publish a message on an MQTT topic.

Options

namedescriptionrequiredchoices
server MQTT broker address/name
port MQTT broker port number
username Username to authenticate against the broker.
password Password for C(username) to authenticate against the broker.
client_id MQTT client identifier
topic MQTT topic name true
payload 1. The special string C("None") may be used to send a NULL (i.e. empty) payload which is useful to simply notify with the I(topic) or to clear previously retained messages. true
qos QoS (Quality of Service)
  • 0
  • 12
retain Setting this flag causes the broker to retain (i.e. keep) the message so that applications that subsequently subscribe to the topic can received the last retained message immediately.

Author

Jan-Piet Mens (@jpmens)