Configure mqtt-broker node from Dashboard

Hello everyone,

I am trying to configure the mqtt-broker node from the dashboard.
I've been searching the forum for a while to see if anyone has tried it, but i haven´t found it.

My intention is with a form node to fill all these fields, instead of filling them from the mqtt-in/mqtt-out node.

Can someone tell me how i can do it?

Thanks.

What i´ve thinked is something like this:

and save this information in a global context to use later and configure mqtt-broker node. But i don´t know how to do that

This link might be useful. Click here

Thanks, but my problem is that i want to set server properties via msg properties as i can do it with the topic, qos or retain properties.
Something like this:


flows (3).json (5.5 KB)
To fill broker object.
image

Hi Since you are new to the forum, Please have a look at this to attach your flows.
To answer your question:
The mqtt-in node doesnt support setting the server details dynamically for various reasons. But, you could do it via environment variables.

Here are the steps:

  • Use a change node and set msg.properties(Obtained from UI) to an environmental variable say MY_ENV_VAR.
  • Open the server details inside your node and enter ${MY_ENV_VAR} in the text box. This should allow you to dynamically set the server configs from your UI.

Hi, should I make an environmental variable for each properties? or Can I make an object with the properties? I am currently testing this second option, but when I go to search for the property MY_ENV_VAR.name does not return the value.

Thanks

I believe node red need to be restarted to see a change in an environment variable.

True that..

That is no longer true. Have a look at the help text for the MQTT In node for the section on dynamic control.

Thanks for this. Ill check that out.

Configuring MQTT In node allows change MQTT out node server and port?

Did you check the help text for the Out node?

See this post for examples of how to configure dynamic MQTT Dynamic MQTT node's "actions->connect" guidance needed

thanks for your help.

It works!!

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