Script variable - call external lua function with curl
Posted: Sunday 03 June 2018 11:22
Hi, I need help, so far I dont know how solve following problem. In script_variable_xxx I call external function, which process data history from counter meter. In this function I use curl function which return result back to script_variable_xxx. But result, which return is still empty. I try call the same function from script_time and result is correct, curl process all history data correctly. But calling from script_variable curl in external function every time return empty result.
curl in externa function:
local config=assert(io.popen('curl --connect-timeout 2 -m 2 -X GET "http://' .. IP_ADDRESS .. '/json.htm?type=graph&sensor=counter&idx=5&range=month"'))
curl in externa function:
local config=assert(io.popen('curl --connect-timeout 2 -m 2 -X GET "http://' .. IP_ADDRESS .. '/json.htm?type=graph&sensor=counter&idx=5&range=month"'))