05.07.2021, 14:40
Try this, might need some adjustments to extract the JSON part from the response.
Code:
lines = res:trim():split('\r\n')
-- remove header lines and chunk size
repeat
line = table.remove(lines, 1)
if line == '' then
table.remove(lines, 1)
break
end
until #lines == 0
-- remove last line
lines[ #lines ] = nil
data = table.concat(lines)
data = require('json').pdecode(data)
log(data.battery.instant_power)
log(data.solar.instant_power)
log(data.site.instant_power)
log(data.load.instant_power)