# MQTT subscribe to selectable Shelly

**URL:** https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339
**Category:** General
**Tags:** mqtt
**Created:** [12 February 2025 09:50 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339 "2025-02-12T09:50:05Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [12 February 2025 09:50 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/1 "2025-02-12T09:50:05Z")

</div>

Hi, there!

I have a **real Shelly** with its original name like `shelly2pm-12345678` and I have a **virtual Shelly** `shelly2pm` only present in Node-RED.

I prepared the UI so the user can select one or another to send the messages to.

Now I want to prepare the UI for unknown, future Shelly2pm in the field. Suppose this is Shelly `shelly2pm-abcdefg`.

Changing the name of Shelly `shelly2pm-abcdefg` in the field to one of the previously defined names is not an option (name clashes ahead and difficult to achieve!).

The user in the field is not supposed to edit flows and add `shelly2pm-abcdefg` or modify hard coded entries.

Did you come across this problem and how did you solve it?

It looks like I cannot solve this with standard MQTT nodes. There was a discussion once upon a time about if or when to change that. And there is 4 yrs old, not-so-extensivly-documented node `mqtt-in-dynamicsub` . But I do not want to introduce fragile, brittle dependencies.

Any help and/or information is appreciated.

Cheers, Uwe

---

<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: [12 February 2025 09:56 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/2 "2025-02-12T09:56:01Z")

</div>

> [@duaw](#):
>
> It looks like I cannot solve this with standard MQTT nodes

Yes you can.

> [@Dynamic MQTT node's "actions-\>connect" guidance needed](https://discourse.nodered.org/t/dynamic-mqtt-nodes-actions-connect-guidance-needed/58878/2):
>
> The dynamic connection does not overwrite fields. It simply connects to the broker specified in the msg you send. You just add a broker (with any settings you like) and set it to NOT auto connect [image] then you send the appropriate msg to set up and connect. Here is a working demo... [mqtt-dyn] [{"id":"a7f43be0a40d080b","type":"mqtt out","z":"8afdb9e0485c9da7","name":"mqtt out","topic":"","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","…

---

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [12 February 2025 10:34 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/3 "2025-02-12T10:34:54Z")

</div>

Brilliant. Missed that. Thanks, Uwe

---

<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: [12 February 2025 10:44 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/4 "2025-02-12T10:44:05Z")

</div>

> [@duaw](#):
>
> Missed that

always pays to check the built in help 😉 :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/37ba01a66032ac8f7f71218c2586b2dc92e97662.png)

---

<div class="post-metadata">

### Author: ![duaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duaw/32/20970_2.png) [@duaw](https://discourse.nodered.org/u/duaw)
#### Post date: [12 February 2025 12:22 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/5 "2025-02-12T12:22:32Z")

</div>

I did. For some reason I am running a localised Node-RED (German). Documentation in German does not have it ... I will have to change language settings.

 ![Bild 12.02.25 um 13.18](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/3391d926abf94941ae51dd195e8485783cc52e04.jpeg)

---

<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: [12 February 2025 13:12 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/6 "2025-02-12T13:12:16Z")

</div>

Ahha. Sorry.

An pull request for translations are always welcome 👼

---

<div class="post-metadata">

### Author: ![kitori](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kitori](https://discourse.nodered.org/u/kitori)
#### Post date: [13 February 2025 09:10 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/7 "2025-02-13T09:10:19Z")

</div>

> <https://github.com/node-red/node-red/pull/5050>
>
> \- \[x\] Bugfix (non-breaking change which fixes an issue)
> \- \[\] New feature (non-…breaking change which adds functionality)
> 
> 
> 
> \## Proposed changes
> 
> 
> 
> As requested: https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/6?u=kitori
> !\[grafik\](https://github.com/user-attachments/assets/e90da0ad-8881-4fb7-a66e-8489af358121)
> 
> 
> \## Checklist
> 
> 
> \- \[x\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> \- \[\] For non-bugfix PRs, I have discussed this change on the forum/slack team.
> \- \[x\] I have run \`npm run test\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

---

<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: [13 February 2025 09:22 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/8 "2025-02-13T09:22:34Z")

</div>

Thanks very much for this.

Please remember to sign the [EasyCLA](https://github.com/node-red/node-red/pull/5050#issuecomment-2655992552) so we can review and merge.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [27 February 2025 09:22 UTC](https://discourse.nodered.org/t/mqtt-subscribe-to-selectable-shelly/95339/9 "2025-02-27T09:22:36Z")

</div>

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