FUXA icon indicating copy to clipboard operation
FUXA copied to clipboard

How to change the json body of MQTT publish

Open JefersonBigheti opened this issue 1 year ago • 3 comments

Hi! It is possible to change the json body of the MQTT publish as follows:

{ "data": { "temperature": 72 }, "time": { "$date": "2016-11-04T19:42:06.710Z" } }

JefersonBigheti avatar Nov 19 '23 12:11 JefersonBigheti

Hi, make sense but we need a configurable payload.

unocelli avatar Nov 23 '23 19:11 unocelli

Hi, Do you have an example of how to change the mqtt publish payload?

JefersonBigheti avatar Nov 25 '23 09:11 JefersonBigheti

Hi, I'm not sure but you can add this code on line 551 of FUXA\fuxa\server\runtime\devices\mqtt\index.js

topicTopuplish = { data: { temperature: topicTopuplish['value'] }, time: { '$date': topicTopuplish['timestamp'] } }

unocelli avatar Nov 26 '23 16:11 unocelli