# MQTT flow parse json

**URL:** <https://community.homey.app/t/mqtt-flow-parse-json/20531>\
**Category:** Flows\
**Created:** [November 10, 2019, 9:38pm UTC](https://community.homey.app/t/mqtt-flow-parse-json/20531 "2019-11-10T21:38:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [November 12, 2019, 8:05pm UTC](https://community.homey.app/t/mqtt-flow-parse-json/20531/2 "2019-11-12T20:05:07Z")

</div>

I have not done it before… although I’ve worked with all the puzzle pieces.  
I think it’s definitely doable.  
Use MQTT client to receive the JSON in the “When” of a flow  
Send the tag (=json data) to a Homeyscript in the “Then” of the flow  
In homeyscript parse the json (you need to create this script first)  
And update the Better logic variable inside the script:

> [@Setting Logic Variable by HomeyScript](https://community.homey.app/t/setting-logic-variable-by-homeyscript/14819/20):
>
> You can also create the variable in BetterLogic and update it like: let BLApp = await Homey.apps.getApp({id:“net.i-dev.betterlogic” }); BLApp.apiPut(‘Klok12h/’ + theHour);

---

_[View the full topic](https://community.homey.app/t/mqtt-flow-parse-json/20531)._
