I am using node-red with v2.2.2 via docker compose environment where I already have two MQTT brokers configured. Since the node-red container and the two eclipse-mosquitto brokers are in the same docker network I wish to configure the MQTT In and MQTT Out nodes already pre-configured to show the two broker names upon double-clicking on them, namely
internal-mqtt-broker has broker address set to internal-mqtt (container-name) with port 1886 external-mqtt-broker has broker address set to external-mqtt (container-name) with port 1883
But since I do not wish to create a new node itself, how can I override the default value for the MQTT In and MQTT Out node with the above mentioned values?
I wish to avoid developing a custom node-red container here and want to use it out of the container?
I would like the user to be presented with the available broker already, once they drag the nodes in the editor
All actions for connecting/disconnecting/subscribing/unscribing are documented in the node (ie. select the mqtt-in node and select the documentation tab on the right side of the node-red ui).
This you could wrap inside a subflow which appears in the node palette.
So based on your suggestion, and if I understand it correctly, if I pack the function (or even a change node as mentioned in the thread above) with a dynamic subscription MQTT in a subflow, it can then be made available as _node_itself for the end user?
Edit
as mentioned by @bakman2 I created a pair of subflows for each mqtt broker (4 in total)
internal mqtt broker in node
internal mqtt broker out node
external mqtt broker in node
external mqtt broker out node
This make it easier for me to drag-and-drop specific mqtt brokers into the flow