The message payload I am after is the 225 chars starting ts1 etc.. How do I setup the serial connection to filter out just that part and pass it into a format which I can send to anywhere e.g. home assistant
The debug is connected directly to the serial, it's a device for storing water and I have Modbus control over it using HA. But I can't get HA to read both Modbus and serial at the same time (think it's a limitation of parallel serial coms or something but so far, no help here) so I thought I would try and pipe it into Node-Red and pass it back to HA. As I suspected the serial dose work as we are getting some readings into Red but now it's just a question of filtering it and making it readable.
The setup for the serial is as follows.
I have tried to play with the setup to see if I can filter/split the incoming to make it meaningful, but I am unsure of the process.
Well you seem to have a nice mix of ascii text and binary data there :-)... If you are sure that the text part always contains ts1 and the binary parts never do - then you could use a simple switch node set to msg.payload ... contains .... ts1 - and that would filter out just those lines.
However the data itself is almost JSON but not quite... so to anticipate Colin's next question - if that data could actually be proper JSON then you could then very easily get to each of the variables inside. One way would be to fix the sending end to send real JSON... the other would be to add a function node (after the switch node we added above) - to "fix up" the string - eg something like.
So the CSV output puts it into columns, which I can name if I want to, but then they I was trying to pop the text after the colon I am getting a syntax error, my JS is not very strong