# Add checkbox to default the MQTT node name to broker name

**URL:** <https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444>\
**Category:** Feature Requests\
**Created:** [10 May 2022 10:33 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444 "2022-05-10T10:33:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 10:33 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/1 "2022-05-10T10:33:46Z")

</div>

But I can see that changing the default automatically to be broker name would muck up some peoples existing flows visually so that's why I'm suggesting adding a checkbox

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/ef86b378d575d841c6b2968467ff16c3787a0549.png)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 May 2022 10:42 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/2 "2022-05-10T10:42:57Z")

</div>

Would be great for dynamically assigned brokers! Happy Cake day too!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 10:45 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/3 "2022-05-10T10:45:33Z")

</div>

Not seeing how it would be useful for dynamic ones - isn't the point of them to change them while the flows running?

Node name can't be updated during flow execution - only at deployment

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 May 2022 10:47 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/4 "2022-05-10T10:47:22Z")

</div>

Of course, my mistake!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 11:32 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/5 "2022-05-10T11:32:48Z")

</div>

If the list of available configs were alphabetical so that your broker named (for example) `1: local broker (default)` would appear before `2: test broker` - would that be a reasonable workaround?

I seem to remember some request for the config nodes to be presented alphabetically (but I cant remember where I seen it! )

@ghayne - happy cake day

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 11:47 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/6 "2022-05-10T11:47:46Z")

</div>

> [@Steve-Mcl](#):
>
> If the list of available configs were alphabetical so that your broker named (for example) `1: local broker (default)` would appear before `2: test broker` - would that be a reasonable workaround?

???

I'm just after the node name being populated by the broker name without having to type it in manually

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 11:53 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/7 "2022-05-10T11:53:24Z")

</div>

I misunderstand your request since the name of the broker is auto generated from the host and port ( when displayed in the config drop down) so long as it's name is empty. I thought you wanted a default broker to be chosen upon adding an MQTT node to the editor.

Ps, now I understand, I don't think that is something I'd personally want. Maybe an alternative solution would be to auto display the broker name if the name of the MQTT out is explicitly left empty and no topic is set.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 11:56 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/8 "2022-05-10T11:56:47Z")

</div>

We today communicate well not 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 11:57 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/9 "2022-05-10T11:57:48Z")

</div>

I've added a "the" to the title 🙂  
[Add checkbox to default the MQTT node name to broker name]

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 12:00 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/10 "2022-05-10T12:00:42Z")

</div>

> [@Steve-Mcl](#):
>
> Maybe an alternative solution would be to auto display the broker name if the name of the MQTT out is explicitly left empty and no topic is set.

> [@cymplecy](#):
>
> But I can see that changing the default automatically to be broker name would muck up some peoples existing flows visually so that's why I'm suggesting adding a checkbox

I don't mind it happening but some other people would be well upset I imagine

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [10 May 2022 13:53 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/11 "2022-05-10T13:53:35Z")

</div>

I, for one, would not use the proposed feature.

I set my Out node names to that of the device that's in the topic but that would be messy to do by default.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 13:59 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/12 "2022-05-10T13:59:22Z")

</div>

The suggestion is to have a little checkbox to save typing the broker name when you want the node to show which broker it's connected to

If left unchecked then it would behave as it does now

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 May 2022 14:20 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/13 "2022-05-10T14:20:17Z")

</div>

Since I use more topics than brokers, I prefer the current default name - the topic set in node config.

But I'd welcome the broker name showing as the node status instead of "connected".  
 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59d6d41e989ce2d3fecc64dc576d20168a13c8b0.jpeg)

---

<div class="post-metadata">

**Author:** ![LosinIt](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LosinIt](https://discourse.nodered.org/u/LosinIt)\
**Post date:** [10 May 2022 14:33 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/14 "2022-05-10T14:33:10Z")

</div>

> [@jbudd](#):
>
> showing as the node status instead of "connected"

There ya go! That would be useful to me. Do the same to the In node, too.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 15:01 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/15 "2022-05-10T15:01:29Z")

</div>

> [@jbudd](#):
>
> Since I use more topics than brokers, I prefer the current default name - the topic set in node config.

I really wasn't clear with my request was I 🙂

This is for when topic is empty and set using msg.topic

Totally agree with sticking to topic if manually entered 🙂

But  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0bdbe2e46f34d04216e18ee7b924f523a36bb034.png)

is genius level thinking - love it 😃 😃 😃

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 May 2022 15:09 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/16 "2022-05-10T15:09:17Z")

</div>

err - so how do you then show the actual status of the connection  
Is copy/paste too hard for the name ?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 May 2022 15:20 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/17 "2022-05-10T15:20:16Z")

</div>

> [@dceejay](#):
>
> err - so how do you then show the actual status of the connection

Red / Green?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 May 2022 15:21 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/18 "2022-05-10T15:21:03Z")

</div>

Needs a shape too since not everyone can differentiate such colours. Could add the status after the name - I quite like that idea.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 15:21 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/19 "2022-05-10T15:21:34Z")

</div>

The green dot signifies state

Maybe in disconnected state - the status would have to add the state on as well e.g mainbroker(disconnected)

You can't (well I can't anyway) copy the server name from the server field - I have to go into the broker config to do that

_All I wanted was one little checkbox ....._

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 May 2022 15:31 UTC](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444/20 "2022-05-10T15:31:53Z")

</div>

Maybe bring the checkbox idea back and use it to add(or not) the broker name in the status?

[Next page](https://discourse.nodered.org/t/add-checkbox-to-default-the-mqtt-node-name-to-broker-name/62444.md?page=2)
