Integration of TTN sensors with multiple values

Hello,

I operate some self-made environmental sensors via LorawAN and the things network.
I would like to have these values available in homematic so that they can be displayed.

I am currently mirroring the MQTT data from TTN in a local MQTT broker via nodered.

The data comes as json in a topic.
The data is already formatted accordingly via the TTN payload decoder .

That doesn’t seem to work

sensor:
 - platform: mqtt
   topic: "v3/tinynode-v2@ttn/devices/+/up"
   device: "{{ value_json['end_device_ids']['device_id'] }}"
   json_attributes_template: >
      { "humidity": {{value_json['uplink_message']['decoded_payload']['h']}},
        "temperature": {{value_json['uplink_message']['decoded_payload']['t']}},
        "voltage": {{value_json['uplink_message']['decoded_payload']['v']}},
        "pressure": {{value_json['uplink_message']['decoded_payload']['p']}},

Unfortunately I don’t know what to configure so that the topic is parsed dynamically (number of sensors can change) and the data processed accordingly.

I have read in MQTT Sensor - Home Assistant, unfortunately the examples always only have one sensor, I needed that dynamically.

Furthermore, I get several values in a topic (pressure, temperature, air humidity, voltage), is ‘json_attributes_template’ the right approach?

Thank you and best regards

Andreas