A valid JSONPath would be $.value[0].soc for soc of the first array element. You’ll need to install JSONPath Transformation Service.
Now, if 4*EB340 is the only device, maybe the simple JSONPath may suffice. The “better” solution is a JSONPath which addresses the correct element in the array: $.value[?(@.name=='4*EB340')].soc
Now JSONPath will search for the element of the array with name = 4*EB340, then return the soc value of this element.
TNX, Udo,
for Your fast and sufficient help.
At the moment, I have only this battery, but I put Your complete string.
I was confused about the [ … ] and didn’t know, how to handle. Can You help me and other readers with a link to a nice description for the syntax?
In question of the simple query (with [0]) my quick ‘n’ dirty solution is VisualStudio Code with JSON Path Status Bar plugin. Just load the JSON as a complete file into the editor and select the value you want to extract. Then at the right side of the status bar you can see the correct JSONPath (and by clicking on the text, it’s transferred into the clipboard). There are other similar tools, e.g. in notepad++ or even as an online evaluator: https://jsonpath.com/
Please be aware that every JSONPath starts with a >$.< (in openHAB JSONPath) so you have to add this part.
For the “advanced stuff” either take a look at the RFC (link above) or (not as complete, but a bit lighter…)