How to send .json strings over MQTT

Hi All,

I have been following this tutorial Link but i cannot get it to work when i replicate it on my machine.
I have tried recreating from scratch and also downloaded the flow itself and reconfigured to my MQTT broker but still without joy.

I want to send this via MQTT
{“analyze”:false, “value”:10}

When i debug from the json node i get this error "Unexpected token “ in JSON at position 1"

When i try to add the switch to the json node and set to msg.payload.analyze to test for True/False i do not get an output from either of them.

I noticed my debug is showing the payload as a string rather than an object, The payload is showed as an object in the lecture article i linked in the debug window. Is this because my message is formatted incorrectly?

Any help is appreciated.

It is literally telling you it doesn't like that non STD quote mark

Replace those smartquotes with normal quotes from your keyboard.

My mistake, i copied the string from the lecture directly and did not spot that the double quotes were different to usual...

What's the idea behind these being different? " “...

Wasted a few hours working out where id gone wrong on this as well. Cheers for your help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.