Hello, i have a "mqtt in" node that receives messages in the from a string from my smart meter. I only need one line from the message or more specifically the last numbers in that line. I have looked around on the forum and other sites and i have found people with similar problems but those solutions have not worked for me.
The number can be smaller or larger so this solution would not work for me. I hope there is someone around that knows of a solution, if i need to provide more info please ask.
Thereās a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.
Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.
So in your case msg.payload.svalue3 will hold the value of interest.
If you are new to node-red, I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
If you are using a MQTT-In node (in Node-RED) you could set the output to be a parsed JSON object then just extract the element you want with a function node or a change node.
Thank you so much! For some reason i put the output of the "mqtt in" node to string instead json after changing that i got the correct output. and together with the suggestion of dynamicdave i got it working just exactly as i was hoping.