# MQTT JSON API Subtopic not working in V0.13.1

**URL:** <https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503>\
**Category:** Issues\
**Created:** [June 12, 2023, 3:26pm UTC](https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503 "2023-06-12T15:26:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteynMarnus](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/steynmarnus/32/5190_2.png) [@SteynMarnus](https://wled.discourse.group/u/SteynMarnus)\
**Post date:** [June 12, 2023, 3:26pm UTC](https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503/1 "2023-06-12T15:26:10Z")

</div>

Hi yall, hope all is well.

I have followed the instructions for using MQTT to controly my WLED using the /api subtopic.

Firtsly I needed to confirm my MQTT setup is wokring at all, so I used [io.adafruit.com](http://io.adafruit.com) as my broker and made a feed - I set it up in my wled settings and send a “off”/“on” on the base device topic works perfectly.

Then when I could see MQTT controll is working, I went to my device topic and subscribed it to the `api` subtopic

Then I tried sending a on/off toggle JSON payload accoriding to the docs, but not luck it does nothing. See below images of my before and after setup and what I tried sending:

 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/a/a4e72d4a953ce1cf904d76a1cfeed4d7e724c86c.png)

I even looked at another user having similiar issues on [this forum post](https://wled.discourse.group/t/mqtt-help/7572), but I have doubled checked and my subtopic and payload is right.

What I have checked:

- After chaning topic, I saved settings and rebooted:

- Double Check Payload and Topic.

What am I missing here?

---

<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:** [June 13, 2023, 1:06am UTC](https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503/2 "2023-06-13T01:06:45Z")

</div>

First I get scarred when i see v013.1 as that could be old , working example on latest build from here [WLED installation (wled-install.github.io)](https://wled-install.github.io/)  
 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/c/c5f86064a9542d6db4fd6ee30f48ffb7d5051c42.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/5/547c4a53605c96064e252c672f3f4a75bf328c07.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/e/e96b882ca61b6107bee50f2c4cee510e19c32dba.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/b/bcce521b7e9268d6e097475d5c45a44615ac227d.png)

---

<div class="post-metadata">

**Author:** ![SteynMarnus](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/steynmarnus/32/5190_2.png) [@SteynMarnus](https://wled.discourse.group/u/SteynMarnus)\
**Post date:** [June 13, 2023, 7:05am UTC](https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503/3 "2023-06-13T07:05:36Z")

</div>

Hi ALDIY,

Thanks I think I understand the problem now - the Device Topic registered on the WLED MQTT settings should not have the `/api` in the end. Its only once you publish to it you add the subtopic?

On the older version, yes I can update that, I just used what I had since MQTT supports has been present since 0.8.X. Do I have to flash my D1 mini with the latest version or can I update it from the WLED settings directly?

Thank you.

---

<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:** [June 13, 2023, 1:40pm UTC](https://wled.discourse.group/t/mqtt-json-api-subtopic-not-working-in-v0-13-1/8503/4 "2023-06-13T13:40:09Z")

</div>

I do not think you can safely upgrade with OTA from that old builds , you could try first but it would be really best to flash with serial even if OTA works just to have a fresh fs
