Mqtt-in variable broker

dear all

for the node mqtt-in how to use variable broker?

You can use dynamic subscriptions to connect to different brokers. It is all in the sidebar help text.
There are plenty of examples posted on forum to, a quick search for mqtt bynamic broker connect brings up many.

Dynamic Subscription

The node can be configured to dynamically control the MQTT connection and its subscriptions. When enabled, the node will have an input and can be controlled by passing it messages.

Inputs

These only apply when the node has been configured for dynamic subscriptions.

actionstring
the name of the action the node should perform. Available actions are: "connect", "disconnect", "subscribe" and "unsubscribe".
topicstring|object|array
For the "subscribe" and "unsubscribe" actions, this property provides the topic. It can be set as either:

  • a String containing the topic filter
  • an Object containing topic and qos properties
  • an array of either strings or objects to handle multiple topics in one

brokerbroker
For the "connect" action, this property can override any of the individual broker configuration settings, including:

  • broker
  • port
  • url - overrides broker/port to provide a complete connection url
  • username
  • password

If this property is set and the broker is already connected an error will be logged unless it has the force property set - in which case it will disconnect from the broker, apply the new settings and reconnect.

1 Like

and here is a demo of most features: Dynamic MQTT LWT birth, Close & Will Property - #2 by Steve-Mcl

thank you sir for the answer.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.