MQTT
Components that connect to an MQTT broker, publish and subscribe.
On this page
Components that connect to an MQTT broker, publish and subscribe. This page holds the catalogue group MQTT.
Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see Download components.
API
component
mqtt-broker.html · version 4
Connects to an MQTT broker and sends the messages it receives.
mqtt-broker.html · version 4| Parameter | Type | Description |
|---|---|---|
host? |
String |
Hostname or IP address. Default: localhost |
port? |
Number |
Port. Default: 1883 |
secure? |
Boolean |
Secure (SSL). Default: false |
clientid? |
String |
Client ID. |
auth? |
String |
Require Authorization. |
username? |
String |
Username. |
password? |
String |
Password. |
lwt? |
String |
Last will topic (LWT). |
lwttopic? |
String |
Last will topic. |
lwtmessage? |
String |
Last will message. |
Inputs: none.
Outputs: output (Messages).
Flow installs the npm package mqtt when you add the component.
component
mqtt-publish.html · version 3
Publishes messages to an MQTT topic.
mqtt-publish.html · version 3| Parameter | Type | Description |
|---|---|---|
broker? |
String |
Broker. |
Inputs: message (Message).
Outputs: none.
MQTT Publish
Input:
{
topic: 'some/topic',
message: { some: 'data' },
// optional
options: {
qos: 0|1|2,
retain: true|false
}
}
component
mqtt-subscribe.html · version 3
Subscribes to an MQTT topic.
mqtt-subscribe.html · version 3| Parameter | Type | Description |
|---|---|---|
broker? |
String |
Broker. |
topic? |
String |
Topic. |
Inputs: none.
Outputs: message (Message).
MQTT Subscribe