# Add a MQTT return to a var

**URL:** <https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635>\
**Category:** Questions & Help\
**Created:** [August 15, 2020, 11:06am UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635 "2020-08-15T11:06:49Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 23, 2020, 12:52pm UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635/41 "2020-08-23T12:52:08Z")

</div>

HTTP isn’t MQTT.

---

<div class="post-metadata">

**Author:** ![Eelke](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelke/32/9188_2.png) [@Eelke](https://community.homey.app/u/Eelke)\
**Post date:** [August 23, 2020, 1:02pm UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635/42 "2020-08-23T13:02:55Z")

</div>

Nope. But you can drag the local tag from your received MQTT topic or message to the HTTP Request “JSONpath Better Logic” card, define the JSONPath and select the Better Logic var where you want the result saved. I use it myself to get values from a JSON MQTT message and update a virtual device with it. I know that with the latest/test version of the MQTT hub this can be done directly, but haven’t tried this yet.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [August 23, 2020, 1:18pm UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635/43 "2020-08-23T13:18:47Z")

</div>

> [@Eelke](#):
>
> But you can drag the local tag from your received MQTT topic or message to the HTTP Request “JSONpath Better Logic” card, define the JSONPath and select the Better Logic var where you want the result saved

Ah I understand what you’re trying to do now. Good idea 👍🏻

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 28, 2023, 6:52pm UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635/44 "2023-05-28T18:52:51Z")

</div>

I have used this method also for a long time, but HTTP requests app is not supported on Homey Pro 2023.

How can I read a value from a JSON string using MQTT client to read the value and then get one value from the JSON string and put it in a number logic or tag (or better logic number)?

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 29, 2023, 9:56am UTC](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635/45 "2023-05-29T09:56:04Z")

</div>

The solution is found: [[APP][Pro] Better Logic Library - For Users - #48 by M\_a\_r\_c\_o](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/48)

[Previous page](https://community.homey.app/t/add-a-mqtt-return-to-a-var/33635.md?page=2)
