My script calls dz.openurl with a callback
Code: Select all
/json.htm?type=devices&rid=2, which successfully returns values,
ie
"Data" : "309 Watt",
"LastUpdate" : "2022-03-25 19:05:43",
Code: Select all
if item.isHTTPResponse and item.isJSON then
local results=item.json.result
for i, node in pairs(results) do
[b]local power = node.Data -- just holding the numeric part without units[/b]
local lastUpdate = Time(node.LastUpdate)
...
end
end
Many Thanks