Can somebody help me with the following issue:
Parse MQTT topic “shellies/shellyplug-582BFC/info”:
{
"wifi_sta": {
"connected": true,
"ssid": "dk8pn_rep3",
"ip": "192.168.1.xxx",
"rssi": -52
},
"cloud": {
"enabled": false,
"connected": false
},
"mqtt": {
"connected": true
},
"time": "",
"unixtime": 0,
"serial": 1,
"has_update": false,
"mac": "12345678",
"cfg_changed_cnt": 0,
"actions_stats": {
"skipped": 0
},
"relays": [
{
"ison": true,
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"overpower": false,
"source": "input"
}
],
"meters": [
{
"power": 0,
"overpower": 0,
"is_valid": true,
"timestamp": 0,
"counters": [
5,
0,
0
],
"total": 0
}
],
"update": {
"status": "unknown",
"has_update": false,
"new_version": "",
"old_version": "20230913-113610/v1.14.0-gcb84623"
},
"ram_total": 52096,
"ram_free": 40740,
"fs_size": 233681,
"fs_free": 165660,
"uptime": 2
}
Want to parse the first (0-th) element of the array “counters” which is actually 5. Applied two JSONPATH transformations for trial but both don’t work out.
JSONPATH:$.meters..counters[0]
and
JSONPATH:$.meters[0].counters[0]
Who can give me a hint?