Spent fuel column

socstur8 years ago

Hello Anton,
The spent fuel column is empty when reporting trips. Does traccar only populate that column with data reported by device? Is there a way to use the trip distance and the fuel consumption of vehicle to populate that field?

Thanks for the help!

Anton Tananaev8 years ago

It uses device data for fuel consumption. It the next release it might be possible to calculate it based on the distance.

socstur8 years ago

Ok thanks. I hope this functionality makes it on the list for the next release. It'll be a big bonus for devices that do not have fuel data.

Anton Tananaev8 years ago

The feature that I'm talking about is already implemented. I'm just not 100% sure it will work in this case.

misosz7 years ago

Hi, and how to calculate this? where to write avg 5,6l for 100km?

Andy Barnard6 years ago

Using copied attributes I copy ignition from one record to another as my device only reports change of ignition state.

Then using computed attributes, I calculated the fuel consumption in l per hour from speed in knots e.g. using the "official" figures for a VW crafter:

ignition ? (speed > 16 ? (0.079 * speed * 1.8952 ) : (speed >5.8 ? (0.14 * speed * 1.8952): 1.5)): 0

I can see the number I expect populate the 'fuelConsumption' attribute state.

I can see that engine hours is calculated by adding up all the time differences between consecutive route points where ignition==true, but for some reason the same doesn't happen for 'spentFuel' in the reports which I assumed would be found by adding up fuel consumption in l/hour also looking at the time differences. Is it possible to make this happen somehow?

Anton Tananaev6 years ago

At the moment spent fuel calculated based on fuel level ("fuel").

Andy Barnard6 years ago

Thanks, that's clear. I appreciate there are lots of ways of looking at fuel/fuel consumption and you have chosen to do it based on fuel level sensor.

As I see it you have fuel level sensor and consumption from the OBD port. Level goes up and down due to filling, theft and driving on bouncy roads with an un-damped fuel level sensor. OBD consumption is usually more accurate based on metering fuel flow into the engine. This latter measurement is what I was trying to 'compute' given that my device doesn't have the ability to actually measure it.

What we would ideally look to do is get fuel filling events from fuel card records (i.e. completely external to traccar), get OBD/estimated OBD fuel use from the vehicle and then use any discrepancies to identify possible anomalies such as fuel thefts or leaks. If I really want to do that, I can almost certainly get the data needed from the SQL database directly or possibly via the API (which I haven't investigated fully).

Anton Tananaev6 years ago

Majority of devices that report fuel information do it by reporting fuel level. That's the reason we use it. We also have fuel theft detection, but obviously you need sensor to report level.

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.