# Shelly Pro RGB and MQTT

**URL:** https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040
**Category:** General
**Created:** [20 December 2024 08:55 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040 "2024-12-20T08:55:32Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [20 December 2024 08:55 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/1 "2024-12-20T08:55:32Z")

</div>

Hi guys,  
I was able to readout a Shelly Pro RGB (not the Shelly RGBW2) via MQTT to Node Red, but I´m not able to control it.  
color picker outputs a string or an object, but I´d need an array. I´m also not sure if it would be enough to send RGB(W) data, or if I need to send brightness as well.

 ![data from color picker in node red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/ba008ba5c5d0c55c9e14baa055d506d447ff017c.png)

 ![filtered from shelly](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/109377ed3a1c82e54db0b5ab39f299a97f270726.png)

 ![unfiltered from shelly](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10eae9de42bfc6f6618e09b6266bd7a6e8022cf2.png)

Here´s what I have so far:  
[flows.json](https://discourse.nodered.org/uploads/short-url/wUaYrLxjSQDv5UsfCc6j7vrL5NZ.json) (15.6 KB)

Anyone knows how to handle that?  
Regards and many thanks in advance

---

<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: [20 December 2024 11:12 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/2 "2024-12-20T11:12:15Z")

</div>

Isn't the pro controlled the same way as the standard RGB device?

If so, I send the following MQTT message to `shellies/shelly_rgbw2_01/color/0/set` with the content set to:

```json
{
    "red": payload.r, 
    "green": payload.g, 
    "blue": payload.b
}

```

That happens to be JSONata in a change node and the payloads come from a web input.

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [20 December 2024 18:29 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/3 "2024-12-20T18:29:25Z")

</div>

Hi,  
the plus needs different communication, like the gen3 units. They provide much more data, like internal temp, voltage and so on.  
Regards

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [20 December 2024 19:07 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/4 "2024-12-20T19:07:14Z")

</div>

> [@Lenaschitz](#):
>
> Hi,  
> the plus needs different communication, like the gen3 units. They provide much more data, like internal temp, voltage and so on.  
> Regards

You should be able to enable mqtt control in the devices http/lan interface, which allows the legacy control over mqtt. you should find it in the mqtt settings page. Then @TotallyInformation suggestion should work.

> **[MQTT | Shelly Technical Documentation](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Mqtt/#mqtt-control)**
>
> The MQTT component handles configuration and status of the outbound MQTT connection. The supported Quality of service level is 1, which guarantees that a message is delivered at least one time to the receiver. Here, you can find how to configure your...

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [23 December 2024 14:23 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/5 "2024-12-23T14:23:27Z")

</div>

Hi guys,  
many thnaks for your input, but I´m still stuck on this issue.  
`shellies/"mqtt prefix"/.......` is for Gen1 units, Gen2 & 3 are using somethin like `"mqtt prefix"/......`  
For reading out the shelly I´m using `"mqtt prefix"/status/rgbw:0`, but I have no clue what I should use for commands. Usually Shelly provides all neccessary data, but since Gen2, documentation gets less and less.  
Regards

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [23 December 2024 16:19 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/6 "2024-12-23T16:19:57Z")

</div>

Gen 2 and 3 use rpc, but as I stated above you can enable mqtt control in the mqtt settings.

 ![chrome_screenshot_23 Dec 2024 16_22_40 GMT](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/585190e8bd7f4ba77a1a40987efdf784c64df129.png)

Did you attempt that?

Else try using the rpc method RGB.set and send the correct params. You set the response topic in the params. [RPC Channels | Shelly Technical Documentation](https://shelly-api-docs.shelly.cloud/gen2/General/RPCChannels#mqtt) - [RGB | Shelly Technical Documentation](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/RGB#rgbset)

Example flow and response topic. set the topic to to \<device\_id\>/rpc

```auto
[{"id":"e52690129360bd8a","type":"mqtt in","z":"d1395164b4eec73e","name":"","topic":"shelly_RGBset/rpc","qos":"2","datatype":"auto-detect","broker":"b288429d0f6eacbf","nl":false,"rap":false,"inputs":0,"x":390,"y":7580,"wires":[["588a356d8f0d8a25"]]},{"id":"588a356d8f0d8a25","type":"debug","z":"d1395164b4eec73e","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":7580,"wires":[]},{"id":"69cbdf6e61c4f96a","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":100000,\"src\":\"shelly_RGBset\",\"method\":\"RGB.set\",\"params\":{\"id\":0,\"on\":true,\"brightness\":50,\"rgb\":[255,255,255]}}","payloadType":"json","x":350,"y":7640,"wires":[["2fc172e9f6ab846e"]]},{"id":"2fc172e9f6ab846e","type":"mqtt out","z":"d1395164b4eec73e","name":"","topic":"<device_id>/rpc","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b288429d0f6eacbf","x":580,"y":7640,"wires":[]},{"id":"b288429d0f6eacbf","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

```

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 18:47 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/7 "2024-12-27T18:47:50Z")

</div>

Hi,  
yes ... I did set it up like you and did some adjustments for the MQTT In & Out node, but without success.

 ![Screenshot (61)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e75024f5d356f613bb29db0ed4031717dab3a9fe.png)  
 ![Screenshot (62)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b97ba5d142e94322165ca721007bb27f6200d03.png)

I´m able to control it directly via a browser using:  
e.g. [http://192.168.1.225/rpc/RGBW.Set?id=0&on=true&brightness=5&rgb=[0,255,255]&white=0](http://192.168.1.225/rpc/RGBW.Set?id=0&on=true&brightness=5&rgb=%5B0,255,255%5D&white=0)

So communication seems to be possible, there´s just something wrong the way I´m doin it ☹

I teached myself how to communicate with lots of othe shelly products using examples provided by the manufacturer, but this Plus RGBW is a pain in the ass.  
Regards

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 19:58 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/8 "2024-12-27T19:58:33Z")

</div>

The topic is not 225/rpc

As stated before it should be ` <device id>/rpc` AS shown in the link provided prior (RPC Channels).

> - Topic for publishing requests: `<shelly-id>/rpc`. To be able to send requests to a device, you must subscribe to this topic, substituting `<shelly-id>` with the relative data for your Shelly device. For example, _shellypro4pm-f008d1d8b8b8/rpc_.

There is an example of switch.set method to on that page.

```auto
mosquitto_pub -h ${MQTT_SERVER} -p ${MQTT_PORT} -t shellyplus1-c4dd57877294/rpc \ -m '{"id":123, "src":"user_1", "method":"Switch.Set", "params":{"id":0,"on":true}}'

```

You would just change the params and method for RGB.set, and set your response topic src.

The device id would be the shelly id in your image. and you should remove the topic prefix of 225 from your settings. You can change the shelly id to make an easier device id if you wish.

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 20:21 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/9 "2024-12-27T20:21:45Z")

</div>

Hi,  
I feel like a dork, but it´s still not woking. I imported your example once more had just changed the \<device\_id\> to the real device\_id. I removed the prefix and after areboot ID & prefix are the same.  
I changed:

 ![Screenshot (64)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e3e84f2a6e854a7036a104775ca0531a7d4b2f9.png)  
into  
 ![Screenshot (65)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/1/e1e3319189b525364303b5c83151f06c8548d83e.png)  
Sorry for consuming so much of your time

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 20:26 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/10 "2024-12-27T20:26:18Z")

</div>

Images are of no help and provide little info, export the flow.

I notice your http request uses RGBW.set, you may need to use this method.

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 20:34 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/11 "2024-12-27T20:34:11Z")

</div>

Hi,  
please find the flow attached:  
[flows(1).json](https://discourse.nodered.org/uploads/short-url/5h3y1e5CncmIKJADtGwM3gsp5QN.json) (2.7 KB)

or here:

```auto
[
    {
        "id": "bc0e2b9ac2648d94",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "0b6ed99e2d913072",
        "type": "mqtt in",
        "z": "bc0e2b9ac2648d94",
        "name": "",
        "topic": "shelly_RGBset/rpc",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "bf3cd836.8e48e8",
        "nl": false,
        "rap": false,
        "inputs": 0,
        "x": 170,
        "y": 60,
        "wires": [
            [
                "d944826d26d7d71e"
            ]
        ]
    },
    {
        "id": "d944826d26d7d71e",
        "type": "debug",
        "z": "bc0e2b9ac2648d94",
        "name": "debug 2",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 60,
        "wires": []
    },
    {
        "id": "a3da6a5fae1a470a",
        "type": "inject",
        "z": "bc0e2b9ac2648d94",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"id\":100000,\"src\":\"shelly_RGBset\",\"method\":\"RGB.set\",\"params\":{\"id\":0,\"on\":true,\"brightness\":50,\"rgb\":[255,255,255]}}",
        "payloadType": "json",
        "x": 130,
        "y": 120,
        "wires": [
            [
                "26f0ff2931ca1ba8"
            ]
        ]
    },
    {
        "id": "26f0ff2931ca1ba8",
        "type": "mqtt out",
        "z": "bc0e2b9ac2648d94",
        "name": "",
        "topic": "shellyplusrgbwpm-30c92257ad08/rpc",
        "qos": "2",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "bf3cd836.8e48e8",
        "x": 430,
        "y": 120,
        "wires": []
    },
    {
        "id": "bf3cd836.8e48e8",
        "type": "mqtt-broker",
        "name": "",
        "broker": "192.168.1.30",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": false,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]

```

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 20:36 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/12 "2024-12-27T20:36:47Z")

</div>

> [@Lenaschitz](#):
>
> please find the flow attached:  
> [flows(1).json](https://discourse.nodered.org/uploads/short-url/5h3y1e5CncmIKJADtGwM3gsp5QN.json) (2.7 KB)  
> Regards

Please share code in the preferred method as it makes copying much easier.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

p.s. please read prior post as I added an edit.

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 20:44 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/13 "2024-12-27T20:44:46Z")

</div>

Sir, done Sir 😉

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 20:46 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/14 "2024-12-27T20:46:09Z")

</div>

Confused

Are you saying it is working using RGBW.set method, rather than RGB.set method?

or

Are you saying you posted the flow correctly?

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 20:53 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/15 "2024-12-27T20:53:02Z")

</div>

Hi,  
the flow was copy-pasted, so I´m sure there are no misstypings. But in the end I´d like to control RGBW. But honestly I got lost it tons of code, I also got some help from shelly support, but they just sending strings, no idea where and how to send.  
I just fogot to adjust QoS and the retain option, before I shared my flow.  
Hopefully that helps for fixing my issue.  
Regards

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 20:57 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/16 "2024-12-27T20:57:08Z")

</div>

> [@Lenaschitz](#):
>
> I´m sure there are no misstypings

I am refering to my edit in a previous post, not a typo.

I am saying your http request via browser uses RGBW.set, So the mqtt message should possibly use RGBW.set not RGB.set. Try changing the method in the inject node to RGBW.set.

[edit] just for info

The mqtt node will take the incoming msg.payload message and convert it to a JSON(string) then send that over mqtt.

---

<div class="post-metadata">

### Author: ![Lenaschitz](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lenaschitz](https://discourse.nodered.org/u/Lenaschitz)
#### Post date: [27 December 2024 21:05 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/17 "2024-12-27T21:05:03Z")

</div>

It works 🥳 🎉  
Now I have to find out, how I can link my node red dashboard to control the stripe.  
Thank you so much for your patience.  
Regards

---

<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: [10 January 2025 21:05 UTC](https://discourse.nodered.org/t/shelly-pro-rgb-and-mqtt/94040/18 "2025-01-10T21:05:08Z")

</div>

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