Olá, tenho um action que envia as operações que são realizadas no dashboard da Tago para tópicos MQTT.
Tenho um APP no celular que monitora os dados recebidos via MQTT. Alguns dados são recebidos normalmente, tenho dificuldades em visualizar o JsonPath de alguns componentes visuais.
Onde posso encontrar o padrão JSON enviado pela Tago quando utiliza MQTT ?
Hi Uberbam,
I’m afraid you won’t get any help by posting your question in Portuguese-BR. The official language in the community channel is English.
Since TagoIO have users around the whole world, I suggest you translate your question by editing your post.
I hope it helps!
Hi Uberdam,
You can utilize MQTTx to look at the MQTT data being sent from TagoIO to the TagoIO Broker.
Example:
const { Analysis, Services } = require(“@tago-io/sdk”);
async function mqttPushExample(context, scope) {
if (!scope.length) {
return context.log(“This analysis must be triggered by a dashboard.”);
}
const deviceID = scope[0].device
const myData = scope.find((x) => x.variable === “form_payload”).value;
const myTopic = scope.find((x) => x.variable === “form_topic”).value;
const myRetain = scope.find((x) => x.variable === “form_retain”).value;
if (!myData || !myTopic || !myRetain) {
return context.log(“Couldn’t find any variable in the scope.”);
}
const myDataObject = {
variable: “Data”,
value: myData,
};
// Create a object with the options you choose
const options = {
retain: myRetain,
qos: 0,
};
// Publishing to MQTT
const MQTT = new Services({ token: context.token }).MQTT;
MQTT.publish({
bucket: deviceID,
message: JSON.stringify(myDataObject),
topic: myTopic,
options,
}).then(context.log, context.log)
}
module.exports = new Analysis(mqttPushExample);
This code will take the following widget: https://admin.tago.io/template/652442a29d7a55000958a11d and send the data in the TagoIO format.
The data arriving:
Notice how I created the myDataObject with the preferred format otherwise it would’ve just sent the data I added in the widget, which in this case was “90”.
Hope this helps! 
The following Example Action I created:
Produces the following message: “90” since the payload is configured like such: $VALUE$