29.01.2024, 12:17
(29.01.2024, 10:58)admin Wrote: Post your full script and describe what exactly you want to achieve.
Code:
http = require('socket.http')
ltn12 = require('ltn12')
res, code = http.request({
url = 'https://horsensvej.rokum.ro/api/v1/entries?token=https%3A%2F%2Fhorsensvej.rokum.ro%2F%3Ftoken%3Dknx-2e4b5b25355f26bb',
method = 'GET',
})
log(res, code)
Code:
lines = data:split('\n')
for _, line in ipairs(lines) do
items = line:split('\t')
log(items)
end
Code:
api 29.01.2024 12:55:29
Resident script:9: attempt to index global 'data' (a nil value)
stack traceback:
I want to put each segment into its own group address, Date, rawvalue, value, direction and CGM
Code:
"2023-11-27T21:26:49.676Z" 1701120409676 219 "SingleUp" "xDrip-LimiTTer"