Template sensor help wanted

I have a hybrid car and would like to know what the electric consumption is and what the petrol consumption is.
This is the ultimate goal.
The first step is to divide the km driven into electricity and petrol.
Since the update frequency of the Audi Connect app is too slow, I use Torque on my mobile phone to send data to the home assistant.
This gives me new data every 10 seconds.
so far everything worked out.

What is the best way to make 3 counters for:
1x total kilometers
1x petrol kilometers
1x electricity kilometers

From the torque app I have the following sensors that I thought I would use.

  • “sensor.torque_distance_travelled_since_codes_cleared” is the mileage
  • “sensor.torque_engine_load_absolute” this is a percentage and 0 -100%
    and when I drive on electricity it is 0% and when I drive on petrol it is somewhere between 1 and 80%