Best way to track consumption (in car)

I have a connection to my car that can read level of gas in the tank, what would the best solution be to track the consumption per day/week/month?

The problem is that it decreases until i refill so a days readings could be:

20, 15, 7, 60, 53 and I would like to log (20 -15 ) + (15-7) + (60-53) and use similar functions as the https://www.home-assistant.io/integrations/utility_meter/