MQTT Subscribe

Subscribe to a topic on an MQTT broker and output the latest payload received.

What it does

MQTT Subscribe connects to an MQTT broker and listens on a topic, feeding whatever arrives into the graph as a live, continuously-updating input. It is the bridge to IoT sensors, lighting and installation controllers, and other apps that speak MQTT.

Given a broker and a topic, it outputs the latest payload as text, the same payload parsed as a number, and whether the subscription is currently connected.

When to use it

ParameterTypeDefault
brokerString"localhost"
portNumber1883
topicString"sensors/temperature"

Gotchas

Check Connected before trusting Payload or Value. Until the subscription connects, or after the broker drops, the outputs hold whatever they last received rather than a fresh reading.

Worked example

  1. Add an MQTT Subscribe node. Set Broker to your broker's hostname and Port to match (1883 is the common default).

  2. Set Topic to the channel you want, e.g. sensors/temperature, or use a wildcard like sensors/+/temperature to catch several sensors.

  3. Wire Connected to something visible while testing, to see the moment the subscription comes alive.

  4. Wire Value into a param for a live numeric feed, or wire Payload downstream if you need the raw text.

See also

MQTT Publish · OSC Input · WebSocket Input · Numbers, signals & audio