02-05-2023, 08:26 AM
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
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