MQTT flow parse json

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: