# MQTT help

**URL:** <https://wled.discourse.group/t/mqtt-help/7572>\
**Category:** Questions\
**Created:** [February 24, 2023, 9:03am UTC](https://wled.discourse.group/t/mqtt-help/7572 "2023-02-24T09:03:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sskol2006](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/sskol2006/32/1893_2.png) [@Sskol2006](https://wled.discourse.group/u/Sskol2006)\
**Post date:** [February 24, 2023, 9:03am UTC](https://wled.discourse.group/t/mqtt-help/7572/1 "2023-02-24T09:03:48Z")

</div>

hello. want to set up control of my wled, via mqtt. what commands in the broker to write to control the brightness and switching of presets? on and off prescribed “on”, “off” - works. on brightness don’t know how…

---

<div class="post-metadata">

**Author:** ![ALDIY](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aldiy/32/2716_2.png) [@ALDIY](https://wled.discourse.group/u/ALDIY)\
**Post date:** [February 24, 2023, 9:18am UTC](https://wled.discourse.group/t/mqtt-help/7572/2 "2023-02-24T09:18:28Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/0/0f7f75b65d63593fa8da685bd3033d722486e82c.png)  
Examples of apis you could use with MQTT :  
Toggole on/off {“on”:“t”}  
Random effect {“seg”:{“id”:0,“fx”:“r”}}  
Change segment name for scrolling text {“seg”:[{“id”:X,“n”:“AAAA”}]} .  
So basically you can use the json api calls [JSON API - WLED MoonModules Project](https://mm.kno.wled.ge/interfaces/json-api/) with mqtt [MQTT - WLED MoonModules Project](https://mm.kno.wled.ge/interfaces/mqtt/)

---

<div class="post-metadata">

**Author:** ![Sskol2006](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/sskol2006/32/1893_2.png) [@Sskol2006](https://wled.discourse.group/u/Sskol2006)\
**Post date:** [February 24, 2023, 9:48am UTC](https://wled.discourse.group/t/mqtt-help/7572/3 "2023-02-24T09:48:27Z")

</div>

I have these settings

 ![Screenshot_2023-02-24-12-47-35-807_com.android.chrome](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/7/7335ad37c0213c062b14216f1f1a7929367f09b3.jpeg)  
 ![Screenshot_2023-02-24-12-47-18-772_com.android.chrome](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/9/9aa4096d5c3b2f7938a2aad85f6e65ae87c23b6d.jpeg)  
the color seems to turn on, but the brightness of the color drops to zero and the LED strip stops shining

---

<div class="post-metadata">

**Author:** ![ALDIY](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aldiy/32/2716_2.png) [@ALDIY](https://wled.discourse.group/u/ALDIY)\
**Post date:** [February 24, 2023, 10:09am UTC](https://wled.discourse.group/t/mqtt-help/7572/4 "2023-02-24T10:09:09Z")

</div>

Cant read that , here are examples to control brightness

To set it to 100 {“seg”:{“id”:0,“bri”:100}}  
Or to increment that by 20 {“seg”:{“id”:0,“bri”:“w~20”}}

![mqtt-bri](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/a/a0511b605ecd96fc7a2ad322278a4c163af6909b.gif)

---

<div class="post-metadata">

**Author:** ![gduprey](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/gduprey/32/2038_2.png) [@gduprey](https://wled.discourse.group/u/gduprey)\
**Post date:** [February 27, 2023, 11:04am UTC](https://wled.discourse.group/t/mqtt-help/7572/5 "2023-02-27T11:04:38Z")

</div>

Just finished an MQTT integration and had similar problems (commands turned LEDs off), until I looked a bit more closely and realized that I had to post my JSON commands to the “/api” sub-topic (i.e. wled/myled/api) vs to the base topic (i.e. weld/myled).

Not sure why I missed that at first, but once I did, everything worked great!

Gerry
