Dragino LHT65 Decode

Can you try to format your code better? It is very hard to read right now. Use code blocks surrounded by ``` (or just use the button) so they are formatted nicely for you like this:

function something(someargument) {
    console.log('hello', someargument);
}

Secondly, I don’t understand your question. Are you asking how to read json and change it? Are you getting any errors with the decodePayload function? Or are you just asking a regular javascript question? If you are just asking how to print a javascript object as a nicely formatted string (which is what I think you mean?) then I would suggest starting a javascript tutorial somewhere. Quick hit on google: JavaScript Objects

You’d probably want something like

console.log(msg.payload.objectJSON);