(31.10.2019, 08:49)MichelDeLigne Wrote: I don't think it is related to the line 101. REST sends a json results, that is supposed to be enclosed in {}.That was a copy paste error from my side. Real JSON answer is:
In your case, I would say the problem is probably with the first "{", that seems to be missing.
Code:
{"id":"/solarCircuits/sc1/collectorTemperature","type":"floatValue","writeable":0,"recordable":1,"value":-0.6,"unitOfMeasure":"C","state":[{"open":-3276.8},{"short":3276.7}]}
Let me rephrase the issue.
The output that I got after the code:
Code:
local endposition = string.find(res, "}", -0)
res = string.sub(res, 0, endposition)
return res
Code:
{"id":"/solarCircuits/sc1/collectorTemperature","type":"floatValue","writeable":0,"recordable":1,"value":-0.6,"unitOfMeasure":"C","state":[{"open":-3276.8}
Anyway, thanks a lot for the code It works like a charm so I'm happy with it!