Hi there,
I have looked and have not found the answer to my problem.
Running NR (Current version: 13.4.0) inside HA, but this is not HA related.
I'm setting up the heating at my home we use Möhlenhoff Alpha units and they use a very specific xml.
Reading is not a problem but when I wnat to submit a change the system throws a 400 error.
After trial and error I found that the error lies in the xml header <?xml version="1.0" encoding="UTF-8" standalone="yes"?> I have tried 2 identical messages (with the header adjusted) and only when I use <?xml version="1.0" encoding="UTF-8"?> so witout the standalone="yes" bit.
I'm not that proficient yet to use function modules so I tried to following set up.
[{"id":"f9e05cfb07dc39ec","type":"inject","z":"69588d0ab0888635","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<?xml version=\"1.0\" encoding=\"UTF-8\"?> <Devices> <Device> <ID>Master1EV</ID> <HEATAREA nr=\"1\"> <T_TARGET>16</T_TARGET> </HEATAREA> </Device> </Devices>","payloadType":"str","x":430,"y":720,"wires":[["cc26578f49972747","38dc09c7d7c3b387"]]},{"id":"cc26578f49972747","type":"http request","z":"69588d0ab0888635","name":"Set Changes","method":"POST","ret":"txt","paytoqs":"ignore","url":"10.10.10.64/data/changes.xml","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"application/xml","valueValue":""}],"x":610,"y":740,"wires":[["fedabfc0174a3e2e"]]},{"id":"fedabfc0174a3e2e","type":"debug","z":"69588d0ab0888635","name":"This works","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":740,"wires":[]},{"id":"38dc09c7d7c3b387","type":"debug","z":"69588d0ab0888635","name":"Working XML (no \"standalone\")","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":700,"wires":[]}]
When I do this it's fine, but to do this I'll probably need to use a function module and just learning Java now so...(tips welcome)
So I tried the following which doesn't work due to the aforementioned " standalone ="yes" " bit
[{"id":"f1f561cc629a44e4","type":"inject","z":"69588d0ab0888635","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Devices> <Device> <ID>Master1EV</ID> <HEATAREA nr=\"1\"> <T_TARGET>16</T_TARGET> </HEATAREA> </Device> </Devices>","payloadType":"str","x":310,"y":860,"wires":[["dd6677f30c54fdda"]]},{"id":"dd6677f30c54fdda","type":"xml","z":"69588d0ab0888635","name":"","property":"payload","attr":"","chr":"","x":450,"y":860,"wires":[["80fadf8f129f6755"]]},{"id":"b37e5535aebe7b27","type":"http request","z":"69588d0ab0888635","name":"Set Changes","method":"POST","ret":"txt","paytoqs":"ignore","url":"10.10.10.64/data/changes.xml","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"application/xml","valueValue":""}],"x":990,"y":860,"wires":[["b4af4e6796c25110"]]},{"id":"d95da73e7a3388ad","type":"xml","z":"69588d0ab0888635","name":"","property":"payload","attr":"","chr":"","x":810,"y":860,"wires":[["b37e5535aebe7b27","42f55eb5cce496c7"]]},{"id":"80fadf8f129f6755","type":"change","z":"69588d0ab0888635","name":"","rules":[{"t":"set","p":"payload.Devices.Device[0].ID[0]","pt":"msg","to":"heat_unit","tot":"global","dc":true},{"t":"set","p":"payload.Devices.Device[0].HEATAREA[0].T_TARGET","pt":"msg","to":"kast_set_temp","tot":"global"},{"t":"set","p":"contentType","pt":"msg","to":"application/xml","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":860,"wires":[["d95da73e7a3388ad"]]},{"id":"42f55eb5cce496c7","type":"debug","z":"69588d0ab0888635","name":"Fault tripping XML due to \"standalone = \"yes\" \"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1100,"y":920,"wires":[]},{"id":"b4af4e6796c25110","type":"debug","z":"69588d0ab0888635","name":"node-red added \"standalone\"lead to error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1260,"y":860,"wires":[]}]
Since the Alpha has it's own Testool I uploaded both versions of the XML and it's the header that lead to faults.
So the big question is, how to get rid of just that pesky bit in the header?