Two separate consumptions on the same socket

Hello

I currently have a zigbee module after a circuit breaker in order to have the consumption of my electric car when I recharge it (sensor.prise_ve_energy)
With this sensor, I created several service counters in order to obtain the consumption per day, year and month and this during Tempo periods in order to obtain the cost of my recharge.
So far no problem!

I now have a second electric car that I recharge on this socket and therefore the same module which calculates consumption.

I would like to separate the consumption of the two vehicles.

For the moment I have duplicated the sensor.energy_1 into a sensor.energy_2

The problem is that I would like that when vehicle A is charging, sensor.energy_2 remains at 0 or is inactive and when vehicle B is charging, sensor.energy_1 is inactive or at 0.

I tried to create a switch with vehicle A and vehicle B and then create a template based on sensor.energy_2 but I’m stuck.

Can you help me and how do you do it?