Calculate the spent fuel

Abazer Mahgoub2 years ago

I need to calculate the spent fuel. My device does not have an ADC port. Can I calculate the consumed fuel based on the odometer? If this is possible please give me an example. I tried in the computed attributes: distance×11.5 (my car consumes 11.5 per km) but got a zero result

Abazer Mahgoub2 years ago

Sorry
Distance×0.0869565217
my car consumes 0.089 L/ km

Slawek2 years ago

computed attributes

attribute - > fuel

999999-(totalDistance *11.5)/100000

type - > number

Abazer Mahgoub2 years ago

Thank you Slawek ..
I will try it

junk2 years ago

I have found solution to calculate the spent fuel for a trip on the trip report. Edit the template of the report trip.xlsx located in templates of the traccar directory. Place in cell Fuel spent- ${distanceUnit.equals("mi") ? "".format("%.1f mi", trip.distance * 0.0065) : distanceUnit.equals("nmi") ? "".format("%.1f nmi", trip.distance * 0.065 / 1000) : "".format("%.1f l", trip.distance * 0.065 / 1000)}
replace the number 0.065 with yours average consumption of the fuel.

jaya year ago

I have tried attribute above: computed attributes

attribute - > fuel

999999-(totalDistance *11.5)/100000

type - > number

In trip report in getting spent fuel = -9997960.67l

any assistance, thanks