Help with a multiple MQTT sensors inside one single topic

Hi guys,
I need some help with templating. I just bought a new power consumption meter. It came with a mqtt feature build in. The problem is that only publish in a single topic all the 5 sensors included. The meter send for example the current consumption in W, in sequence he send the energy output to grid in kwW, and so on. He keep rewriting the same topic all over again.
Here you guys can see the messages sent by the unit:

05/11/2022 13:31:27 
{"variable":"EPT_C", "value":1.38,"unit":"kWh"}
05/11/2022 13:31:27(-0 seconds) 
{"variable":"EPT_G", "value":9.34,"unit":"kWh"}
05/11/2022 13:31:27(-0 seconds) 
{"variable":"IA", "value":24.56,"unit":"A"}
05/11/2022 13:31:27(-0.04 seconds) 
{"variable":"UA", "value":242.35,"unit":"V"}
05/11/2022 13:31:27(-0.05 seconds) 
{"variable":"PA", "value":-5986.25,"unit":"W"}

The variables he send is: EPT_C, EPT_G, IA, UA and PA.

Do you guys know how can i integrate that inside a mqtt sensor inside HA?

Currently stuck in this:

- platform: mqtt
  name: medidor1_pa
  device_class: power
  unit_of_measurement: "W"
  state_topic: 'sensor/medidor1'
  value_template: >-

Did you find any answer already? I’m facing a identical problem.

You could create a set of sensors like this, using the new MQTT layout:

mqtt:
  - sensor:
      - name: medidor1_pa
        state_topic: 'sensor/medidor1'
        device_class: power
        unit_of_measurement: "W"
        value_template: >-
          {% if value_json['variable'] == 'PA' %}
            {{ value_json['value'] }}
          {% else %}
            {{ states('sensor.medidor1_pa') }}
          {% endif %}

When a new message is received, it checks the variable, and returns the value if appropriate, or the existing state of the sensor (a “do nothing” action) if not.

I don’t know if HA would cope with the new messages coming so quickly, whether there’s a proper “queue”. Only one way to find out…