JSON parsing - Printable Version +- Virtuino Forum (https://virtuino.com/forum) +-- Forum: Virtuino (https://virtuino.com/forum/forumdisplay.php?fid=1) +--- Forum: Virtuino IoT (https://virtuino.com/forum/forumdisplay.php?fid=2) +--- Thread: JSON parsing (/showthread.php?tid=1205) |
JSON parsing - Ciberyan - 02-05-2023 Hello Ilias I have my json parsing well with message having only one level Example : { "Battery": 100, "LastUpdate": "2023-02-03 19:11:39", "RSSI": 5, "description": "", "dtype": "Temp + Humidity", } But I dont know how to fill the JSON path when there are more that one level Example (how to reach the fourh line Temperature) : { "Time": "2023-02-04T19:37:20", "ATC087c2e": { "mac": "a4c138087c2e", "Temperature": 22.8, "Humidity": 43, "DewPoint": 9.5, "Battery": 43, "RSSI": -96 "Time": "2023-02-04T19:37:28", "Switch1": "ON", "Switch2": "ON", "ENERGY": { "TotalStartTime": "2022-04-10T21:05:51", "Total": 0, "Yesterday": 0, "Today": 0, "Period": [ 0, 0 ], "Power": [ 0, 0 ], "ApparentPower": [ 0, 0 ], "ReactivePower": [ 0, 0 ], "Factor": [ 0, 0 ], "Voltage": 228, "Current": [ 0, 0 ], "BL09XX": { "Temperature": 36.2 } }, "ATC2da007": { "mac": "a4c1382da007", "Temperature": 22.8, "Humidity": 42, "DewPoint": 9.2, "Battery": 64, "RSSI": -91 }, "TempUnit": "C" } Thanks for your help RE: JSON parsing - iliaslamprou - 02-05-2023 Hi, try this syntax for Json inside json ATC087c2e/Temperature for the array inside Json: ENERGY/Period[1] Other examples sensors/temperature/date sensors/device[1]/temperature/ for the last value of an array sensors/device/value[10000]/timestamp for json inside array in root [2]/temperature |