I am experimenting with HTTPResponse and json and I have a question about accessing the data in a json table.
This is the call I do:
Code: Select all
url = 'http://192.168.1.231:8080/json.htm?type=devices&rid=230E',
method = 'GET',
callback = 'trigger', -- see httpResponses above.Code: Select all
if (item.isHTTPResponse) then
if (item.statusCode == 200) then
if (item.isJSON) then
local someValue = item.json.Sunrise
Now the question:
If the json looks like:
Code: Select all
"Sunrise" : "08:15",
"Sunset" : "17:34",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "17.5 C, 55 %",I have tried all kinds of combinations:
Code: Select all
local someValue = item.json.result.Data - Doesn't work returns "nil"
local someValue = item.json.result:Data - Doesn't work returns "nil"
local someValue = item.json.["result.Data"] - Doesn't work returns "nil"I hope someone can help me