Split Total Energy Into Separate Sensors

Hi,

I have a wallbox with a Shelly giving current (charging) power and total energy.
I’d like to get charged energy per car by means of individual sensors per car.

My current approach is to have a input_select to select the car. With that I created a template power sensor for each car which returns zero or the current power for the selected car. Using an integration sensor on top of the power sensor of every car I get the energy for each car.

I don’t really like doing the integration in HA instead of just using “real” energy values from the Shelly.

Is there any other way of splitting the total energy value delivered by the Shelly sensor according to the state of the input_select?
It should be possible with utility_meter configuring (using the cars as tariff). But, from what I see I only get the values for the period and no total (increasing) values.
Is there any other neat way to follow/track changes of some sensor in a template sensor only when some condition is met?

Thanks!