Victron, multiple values in one topic

The Victron Venus includes an MQTT broker to retrieve data. But there is also a topic that combines several data, does anyone know how to get them in Openhab?

I pick up individual values that way.

Type number : V_DC_Power "Victron DC Power"    [ stateTopic="N/0000000024d7/battery/512/Dc/0/Power", transformationPattern="JSONPATH:$.value"]

Which way do I have to go to pick up individual values, or does everything always have to be picked up completely and broken down into OH.

{"value": 
      [
               {"voltage": 49.560001373291016,
                "state": 0, 
               "current": 0.0, 
               "soc": 76.0, 
               "active_battery_service": false, 
               "name": "PylonMPlus", 
               "id": "com.victronenergy.vebus.ttyO5", 
               "instance": 261, 
               "power": 2
              }, 
             {"instance": 512, 
              "state": 0, 
              "voltage": 49.689998626708984, 
              "soc": 76, 
              "active_battery_service": true, 
              "current": -0.10000000149011612, 
              "id": "com.victronenergy.battery.socketcan_can1", 
              "name": "Pylontech1", 
              "temperature": 8.600000381469727, 
              "power": -4
             }
           ]
      }

What would you like to achieve ?
In case you would like to get the individual values you can extract them by using individual channels. Values then will be extracted using JSONPATH.

transformationPattern="JSONPATH:$.value[1].[id]"

to extract “com.victronenergy.battery.socketcan_can1”

1 Like

Unfortunately does not work.

[WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: An error occurred while transforming JSON expression.

OK, figured it out myself, the rear brackets were too much. Thanks for the direction

transformationPattern="JSONPATH:$.value[1].id"

Would be safer to use a filter instead:

transformationPattern="JSONPATH:$.value[?(@.id == 'com.victronenergy.battery.socketcan_can1')].voltage"

As a result, you would get voltage value from the part with id com.victronenergy.battery.socketcan_can1