Changing String to JavaScript Object

I'm trying to readout a heat meter. The data of the meter is send via M-Bus to a Teltonika TRB 143 router and then send over MQTT to my NodeRed. On the router i can choose between the data format XML and HEX.
if i use XML i get the following data:

<?xml version="1.0" encoding="ISO-8859-1"?> <MBusData> <SlaveInformation> <Id>66180143</Id> <Manufacturer>DME</Manufacturer> <Version>160</Version> <ProductName></ProductName> 
<Medium>Heat: Outlet</Medium> <AccessNumber>0</AccessNumber> <Status>00</Status> <Signature>0000</Signature> </SlaveInformation> 
<DataRecord id="0"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70880</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
</DataRecord> <DataRecord id="1"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="2"><Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31850</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="3"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3297988</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="4"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Power (W)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="5"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume flow (m m^3/h)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="6"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Flow temperature (1e-1 deg C)</Unit> <Value>752</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> 
</DataRecord> <DataRecord id="7"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Return temperature (1e-1 deg C)</Unit> <Value>715</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> 
</DataRecord> <DataRecord id="8"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Temperature Difference (1e-1 deg C)</Unit> <Value>37</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> 
</DataRecord> <DataRecord id="9"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Operating time (hours)</Unit> <Value>30728</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> 
</DataRecord> <DataRecord id="10"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Time Point (time &amp; date)</Unit> <Value>2023-07-25T16:23:00</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> 
</DataRecord> <DataRecord id="11"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70579</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="12"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3280495</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="13"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="14"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31846</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>
 </DataRecord> <DataRecord id="15"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Time Point (date)</Unit> <Value>2023-06-30</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> </DataRecord> </MBusData> `

With the MQTT Node i only get a string as an output and cannot use the data, i want a JavaScript Object. When i choose the option: "output: parsed J-SON object", i just get "failed to parse json string".

How can i convert my string to a JS object?

Looks like an xml string, have you tried passing it through the xml node? Then you could possibly parse the string values.
[edit] with new xml shown this will work.

So the Problem is with the meter?

The problem is the xml is not well formed, you could still parse the text
this will return an array of arrays, each line has been split into an array.

[{"id":"fb225a074e30c5e4","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":2580,"wires":[["0355d5d7d41485f9"]]},{"id":"0355d5d7d41485f9","type":"template","z":"b9860b4b9de8c8da","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> 66180143 DME 160\nHeat: Outlet 0 00 0000\nInstantaneous value 0 Energy (10 kWh) 70880 2023-07-25T13:54:03Z\nInstantaneous value 0 1 0 Energy (10 kWh) 0 2023-07-25T13:54:03Z\nInstantaneous value 0 2 0 Volume (1e-2 m^3) 31850 2023-07-25T13:54:03Z\nInstantaneous value 0 Volume (1e-2 m^3) 3297988 2023-07-25T13:54:03Z\nInstantaneous value 0 Power (W) 0 2023-07-25T13:54:03Z\nInstantaneous value 0 Volume flow (m m^3/h) 0 2023-07-25T13:54:03Z\nInstantaneous value 0 Flow temperature (1e-1 deg C) 752 2023-07-25T13:54:03Z\nInstantaneous value 0 Return temperature (1e-1 deg C) 715 2023-07-25T13:54:03Z\nInstantaneous value 0 Temperature Difference (1e-1 deg C) 37 2023-07-25T13:54:03Z\nInstantaneous value 0 Operating time (hours) 30728 2023-07-25T13:54:03Z\nInstantaneous value 0 Time Point (time & date) 2023-07-25T16:23:00 2023-07-25T13:54:03Z\nInstantaneous value 1 Energy (10 kWh) 70579 2023-07-25T13:54:03Z\nInstantaneous value 1 Volume (1e-2 m^3) 3280495 2023-07-25T13:54:03Z\nInstantaneous value 1 1 0 Energy (10 kWh) 0 2023-07-25T13:54:03Z\nInstantaneous value 1 2 0 Volume (1e-2 m^3) 31846 2023-07-25T13:54:03Z\nInstantaneous value 1 Time Point (date) 2023-06-30 2023-07-25T13:54:03Z","output":"str","x":260,"y":2580,"wires":[["aba5d542df68bb74"]]},{"id":"aba5d542df68bb74","type":"split","z":"b9860b4b9de8c8da","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":390,"y":2580,"wires":[["88f3458b8494196d"]]},{"id":"88f3458b8494196d","type":"split","z":"b9860b4b9de8c8da","name":"","splt":" ","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":470,"y":2620,"wires":[["f50ca5f0b41836f4"]]},{"id":"f50ca5f0b41836f4","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":2620,"wires":[["27c123f9bffb9a28"]]},{"id":"27c123f9bffb9a28","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":790,"y":2620,"wires":[["dad8f729924fec2a"]]},{"id":"dad8f729924fec2a","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":2580,"wires":[["75f30a6a2953f462"]]},{"id":"75f30a6a2953f462","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"parts.key","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"15","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":950,"y":2580,"wires":[["f7d9c9c5f5dcd2a0"]]},{"id":"f7d9c9c5f5dcd2a0","type":"debug","z":"b9860b4b9de8c8da","name":"debug 324","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":2580,"wires":[]}]

[edit] with the supplied xml data you could do this

[{"id":"d2d53d98561094b0","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":2400,"wires":[["f939ec7239531a3d"]]},{"id":"f939ec7239531a3d","type":"template","z":"b9860b4b9de8c8da","name":"simulte incoming","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> <MBusData> <SlaveInformation> <Id>66180143</Id> <Manufacturer>DME</Manufacturer> <Version>160</Version> <ProductName></ProductName> \n<Medium>Heat: Outlet</Medium> <AccessNumber>0</AccessNumber> <Status>00</Status> <Signature>0000</Signature> </SlaveInformation> \n<DataRecord id=\"0\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70880</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n</DataRecord> <DataRecord id=\"1\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"2\"><Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31850</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"3\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3297988</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"4\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Power (W)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"5\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume flow (m m^3/h)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"6\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Flow temperature (1e-1 deg C)</Unit> <Value>752</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"7\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Return temperature (1e-1 deg C)</Unit> <Value>715</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"8\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Temperature Difference (1e-1 deg C)</Unit> <Value>37</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"9\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Operating time (hours)</Unit> <Value>30728</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"10\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Time Point (time &amp; date)</Unit> <Value>2023-07-25T16:23:00</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"11\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70579</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"12\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3280495</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"13\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"14\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31846</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"15\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Time Point (date)</Unit> <Value>2023-06-30</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> </DataRecord> </MBusData> ","output":"str","x":330,"y":2400,"wires":[["4956b07907aa9190"]]},{"id":"4956b07907aa9190","type":"xml","z":"b9860b4b9de8c8da","name":"","property":"payload","attr":"","chr":"","x":450,"y":2420,"wires":[["6bbb9759d80e52fd"]]},{"id":"6bbb9759d80e52fd","type":"debug","z":"b9860b4b9de8c8da","name":"debug 325","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":2440,"wires":[]}]

the second flow looks good, but when i try it with the original message i get : "Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: ["

This is what my MQTT Node recieves:

[<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>

    <SlaveInformation>
        <Id>66180143</Id>
        <Manufacturer>DME</Manufacturer>
        <Version>160</Version>
        <ProductName></ProductName>
        <Medium>Heat: Outlet</Medium>
        <AccessNumber>144</AccessNumber>
        <Status>00</Status>
        <Signature>0000</Signature>
    </SlaveInformation>

    <DataRecord id="0">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>Energy (10 kWh)</Unit>
        <Value>70892</Value>
        <Timestamp>2023-07-26T13:33:21Z</Timestamp>
    </DataRecord>

    <DataRecord id="1">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Tariff>1</Tariff>
        <Device>0</Device>
        <Unit>Energy (10 kWh)</Unit>
        <Value>0</Value>
        <Timestamp>2023-07-26T13:33:21Z</Timestamp>
    </DataRecord>

    <DataRecord id="2">
        <Function>Instantaneous value</Fun... 

Occurs the error because of the opening Gap?

Where did the [ come from in the first character? Not there in post 1 example.

I accidentally posted the data from the router directly, not from the recieving MQTT node. Also the data seems to be cut

Show us a debug of the data coming in from mqtt node.
The debug truncates display to 1000 chars, the data is still all there in the flow though.

[,<?xml version="1.0" encoding="ISO-8859-1"?>
<MBusData>

    <SlaveInformation>
        <Id>66180143</Id>
        <Manufacturer>DME</Manufacturer>
        <Version>160</Version>
        <ProductName></ProductName>
        <Medium>Heat: Outlet</Medium>
        <AccessNumber>202</AccessNumber>
        <Status>00</Status>
        <Signature>0000</Signature>
    </SlaveInformation>

    <DataRecord id="0">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Unit>Energy (10 kWh)</Unit>
        <Value>70892</Value>
        <Timestamp>2023-07-26T14:29:46Z</Timestamp>
    </DataRecord>

    <DataRecord id="1">
        <Function>Instantaneous value</Function>
        <StorageNumber>0</StorageNumber>
        <Tariff>1</Tariff>
        <Device>0</Device>
        <Unit>Energy (10 kWh)</Unit>
        <Value>0</Value>
        <Timestamp>2023-07-26T14:29:46Z</Timestamp>
    </DataRecord>

    <DataRecord id="2">
        <Function>Instantaneous value</Fu...

I want to see the image/screenshot so i can see what type the info is, you have already posted the above and this time there is an extra [,. The image will clarify what is there.

Is that coming straight out of the mqtt node? The topic looks odd, or is the mqtt topic Test123?

Ok if that is coming from the mqtt node the data being sent is malformed. The characters before the <xml .... > need to be removed.

Either fix it in the sensor sending (if you have access) or you can use a change node to remove them
e.g.

[{"id":"d2d53d98561094b0","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":2340,"wires":[["f939ec7239531a3d"]]},{"id":"f939ec7239531a3d","type":"template","z":"b9860b4b9de8c8da","name":"simulte incoming","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[,<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> <MBusData> <SlaveInformation> <Id>66180143</Id> <Manufacturer>DME</Manufacturer> <Version>160</Version> <ProductName></ProductName> \n<Medium>Heat: Outlet</Medium> <AccessNumber>0</AccessNumber> <Status>00</Status> <Signature>0000</Signature> </SlaveInformation> \n<DataRecord id=\"0\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70880</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n</DataRecord> <DataRecord id=\"1\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"2\"><Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31850</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"3\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3297988</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"4\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Power (W)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"5\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Volume flow (m m^3/h)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"6\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Flow temperature (1e-1 deg C)</Unit> <Value>752</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"7\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Return temperature (1e-1 deg C)</Unit> <Value>715</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"8\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Temperature Difference (1e-1 deg C)</Unit> <Value>37</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"9\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Operating time (hours)</Unit> <Value>30728</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"10\"> <Function>Instantaneous value</Function> <StorageNumber>0</StorageNumber> <Unit>Time Point (time &amp; date)</Unit> <Value>2023-07-25T16:23:00</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> \n</DataRecord> <DataRecord id=\"11\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Energy (10 kWh)</Unit> <Value>70579</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"12\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Volume (1e-2 m^3)</Unit> <Value>3280495</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"13\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>1</Tariff> <Device>0</Device> <Unit>Energy (10 kWh)</Unit> <Value>0</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"14\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Tariff>2</Tariff> <Device>0</Device> <Unit>Volume (1e-2 m^3)</Unit> <Value>31846</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp>\n </DataRecord> <DataRecord id=\"15\"> <Function>Instantaneous value</Function> <StorageNumber>1</StorageNumber> <Unit>Time Point (date)</Unit> <Value>2023-06-30</Value> <Timestamp>2023-07-25T13:54:03Z</Timestamp> </DataRecord> </MBusData> ","output":"str","x":350,"y":2340,"wires":[["fc42e1307ac4d436"]]},{"id":"fc42e1307ac4d436","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"<\" & $substringAfter($$.payload,\"<\") ","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":2400,"wires":[["4956b07907aa9190"]]},{"id":"4956b07907aa9190","type":"xml","z":"b9860b4b9de8c8da","name":"","property":"payload","attr":"","chr":"","x":470,"y":2400,"wires":[["6bbb9759d80e52fd"]]},{"id":"6bbb9759d80e52fd","type":"debug","z":"b9860b4b9de8c8da","name":"debug 325","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":2380,"wires":[]}]

i named the topic like test for testing purpose

Then I get the error:
error

Error: Unclosed root tag Line: 67 Column: 26 Char:

Set the debug node showing what is coming from mqtt to output to the console (as well as the debug pane). Then look in the node-red log and you will be able to see the complete object and check the end looks correct.

It seems like it's just working, if the Router isn't sending the messages every minute. I changed it to 10 minutes, now it`s working. Thank you all very much!!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.