--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/Q9cHRBbnwvU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
If they really are always sending JSON { } and they may come back to back... but }{ is invalid JSON - so you may not need to count... (though there may be whitespace in between)...
--
Works perfectly! :) Thanks a lot for all the help guys!
example flow with }{ splitter.... uses new node.send capability in Node-RED v0.10.6....[{"id":"fc1ff116.03e01","type":"inject","name":"Set temp to 20","topic":"","payload":"{\"foo\":20}{\"bar\":30}{\"doh\":40}","payloadType":"string","repeat":"","crontab":"","once":false,"x":195,"y":1662,"z":"dd17b386.22e85","wires":[["5363832b.ac9c7c"]]},{"id":"5363832b.ac9c7c","type":"function","name":"}{ splitter","func":"\nwhile (msg.payload.indexOf(\"}{\") !== -1) {\n var s = msg.payload.indexOf(\"}{\");\n var a = msg.payload.substr(0,s+1);\n node.send({payload:a});\n msg.payload = msg.payload.substr(s+1);\n}\n\nreturn msg;","outputs":1,"valid":true,"x":401,"y":1628,"z":"dd17b386.22e85","wires":[["13c67db9.ec3982"]]},{"id":"13c67db9.ec3982","type":"json","name":"","x":583,"y":1629,"z":"dd17b386.22e85","wires":[["9d55a9d1.62aa58"]]},{"id":"9d55a9d1.62aa58","type":"debug","name":"","active":true,"console":"false","complete":"false","x":749,"y":1671,"z":"dd17b386.22e85","wires":[]}]
--