i get a json object via MQTT from a CO2 sensor and need a tip how to extract the value of svalue 1129 and 23.0. the value 1129 is 5 or 4 digits.
Example:
{"idx":1,"RSSI":6,"nvalue":0,"svalue":"1129;23.0;33024.00“}
If, in the MQTT node, you select the output as Parsed JSON then it will parse the JSON string for you and output a javascript object. Then you can reference the properties as, for example, msg.payload.svalue.
Then to parse svalue you can, in a function node, split it at the semi colons into an array using const values = msg.payload.svalue.split(";")
Now values[0] will be the string "1129", values[1] will be "23.0" and so on.
Finally if you want the values as numbers rather than strings then you can use, for example Number(values[0])