An incoming mqtt message, which is a string: "De frietpan is aangezet!" ,returns the following error 4 times:
12-4-2020 09:29:39node: 26a592da.b81be6
msg : string[40]
"Unexpected token D in JSON at position 0"
It doesn't matter if I use the JSON parser node or not. Both situations return the error (4 times)
The only difference is that if the JSON parser is not used, the string is also returned.
12-4-2020 09:29:39node: 1889fa0d.7b68c6
domoticz/out : msg.payload : string[24]
"De frietpan is aangezet!"
When I view the message in MQTT.fx, I see nothing strange, it just publishes: De frietpan is aangezet!
If I send the message in this format: {"msg": "De frietpan is aangezet!"}, then the message is correct without errors. is node-red expecting a format like this then?
Nothing wrong with the message, something in Nodered is trying to do something with the payload expecting it to be a JSON. Thats why Im asking. If you click on the node id in the debug tab it will show you the node that gives this error.
Great, now you need to find the node reporting the error. copy the node id (26a592da.b81be6) and do a FIND in the editor to find the node producing the error.
As I said in the beginning of this thread you can double click on the node id in the debug window and it will show you the nodes throwing the errors.
If they are not in subflows.
yes I have several flows receiving messages from domoticz/out...the in coming messages are all in JSON format...
This message is not in JSON format, just a string....could that be the error?
If you want to send both JSONs and Strings on the same topic you will have to use something like a switch node to filter out those Strings before the Json parsers