Hello,
Can someone help, how to get the value of this JSON response?
I cannot use index position, since the position is not always the same.
So, using the { “attribute_key” : “value” } is the best.
My question is, how to filter specific key/value pair, and get the “value” in same JSON child.
For example, if I need to get value of “long_v”, which is the value for “temperature”.
I cannot figure this out
{
"attribute_kv": [
{
"attribute_key": "temperature",
"long_v": 30,
"dbl_v": null
},
{
"attribute_key": "cloudCover",
"long_v": 19,
"dbl_v": null
},
{
"attribute_key": "solarDNI",
"long_v": null,
"dbl_v": 178.23
},
{
"attribute_key": "inactivityTimeout",
"long_v": 600000,
"dbl_v": null
},
{
"attribute_key": "refresh_api",
"long_v": null,
"dbl_v": null
},
{
"attribute_key": "inv_qty",
"long_v": 3,
"dbl_v": null
},
{
"attribute_key": "total_capacity",
"long_v": 3,
"dbl_v": null
},
{
"attribute_key": "solarDHI",
"long_v": null,
"dbl_v": 65.05
},
{
"attribute_key": "weatherCode",
"long_v": 1100,
"dbl_v": null
},
{
"attribute_key": "solarGHI",
"long_v": null,
"dbl_v": 149.12
},
{
"attribute_key": "active",
"long_v": null,
"dbl_v": null
},
{
"attribute_key": "lastDisconnectTime",
"long_v": 0,
"dbl_v": null
},
{
"attribute_key": "lastConnectTime",
"long_v": 0,
"dbl_v": null
},
{
"attribute_key": "lastInactivityAlarmTime",
"long_v": 1628075359929,
"dbl_v": null
},
{
"attribute_key": "pv_inv_ratio",
"long_v": null,
"dbl_v": 1.2
},
{
"attribute_key": "lastActivityTime",
"long_v": 1628074741182,
"dbl_v": null
},
{
"attribute_key": "lat",
"long_v": null,
"dbl_v": -6.224007000203784
},
{
"attribute_key": "lon",
"long_v": null,
"dbl_v": 106.6603225304693
}
]
}