Standard Summary Report ignores cumulative fuel attributes on stationary equipment (excavators) after refueling

Naeim 23 days ago

Hello everyone,

I am facing an issue with fuel consumption calculations in the standard Summary Report for stationary equipment (excavators/generators) that works on a single spot without generating odometer mileage.

What I did:
To calculate fuel consumption strictly on standing vehicles, I implemented a true cumulative fuel counter using Computed Attributes (JEXL expressions). I created two attributes assigned to a Teltonika tracker:

fuel (Number): Calculates current liters from IO elements.

fuelUsed (Number): A cumulative odometer that aggregates only fuel drops and "freezes" during refuel events:
prevPosition != null && prevPosition.getAttributes().containsKey("fuelUsed") ? (fuel != null && prevPosition.getAttributes().containsKey("fuel") && fuel < prevPosition.getDouble("fuel") ? prevPosition.getDouble("fuelUsed") + (prevPosition.getDouble("fuel") - fuel) : prevPosition.getDouble("fuelUsed")) : 0

I also adjusted my traccar.xml server configuration to support stationary monitoring:

<entry key='report.ignoreOdometer'>true</entry>
<entry key='processing.fuel.ignoreIgnitionOff'>false</entry>
<entry key='processing.fuel.speedThreshold'>0.0</entry>
<entry key='filter.skipAttributes'>fuel,fuelUsed,ignition</entry>

The Problem:
The fuelUsed attribute compiles and saves to the database absolutely correctly. During the test, the machine burned 11 liters on standby (fuel dropped from 20L to 9L), and the cumulative counter reflected this. Then, a refuel event occurred back up to 19L.

However, the Summary Report completely ignores the fuelUsed database records for the total period. It calculates consumption using simple stateless arithmetic: Initial Fuel (20L) - Final Fuel (19L) = 1L. The actual 11 liters burned before lunch are completely lost in the report layout, even though they are recorded point-by-point in the positions table.

It seems the Summary report only uses the difference of cumulative attributes if the vehicle is moving (has trips/odometer changes), but defaults to raw fuel level differences if the speed is 0.

My Question:
How can we force the standard Summary Report to show actual cumulative consumption for stationary machinery when refuels happen on the spot? Is there a way to patch the report logic or an alternative configuration so that the end-user can click a single button and get a true total consumption (e.g., 11L consumed before refuel + new consumption) without it resetting?

Thank you in advance!

Anton Tananaev 23 days ago

You're using some hallucinated configuration parameters and your computed attributes expression also seems completely invalid.

Naeim 23 days ago

Thank you for the direct feedback, Anton. I appreciate it.
​Let's strip away all the custom JEXL logic and unverified config keys. Let's look at this from a standard Traccar architecture perspective.
​We have a purely stationary asset (an excavator working on a single spot, 0.0 km/h speed, no odometer change). It consumes 50 liters of fuel before lunch, then it gets refueled back to its initial level on the spot, and then consumes another 50 liters after lunch.
​If we only use a basic computed attribute for fuel (translating raw bytes to liters) and standard native Traccar configuration, the Summary Report calculates consumption as Initial Fuel - Final Fuel, resulting in 0 liters spent for the whole day because the refueling brought the level back to the starting point.
​Could you please guide me on the correct, official way to configure Traccar so that the standard Summary Report can properly calculate and display the true total consumption (100L) for stationary equipment when refuels happen on the spot? What are the proper configuration keys for this use case?

Anton Tananaev 23 days ago

You don't need any configuration keys. You just need usedFuel value.

Naeim 23 days ago

Thank you, Anton. Your short answer pointed me in the exact right direction.
​I realized that instead of inventing custom database attributes like fuelUsed, I should map the cumulative math directly to the native, officially supported fuelConsumption attribute (which is translated as "Расход топлива" in the Russian UI).
​To verify this officially supported path, here is the clean configuration and setup I have prepared for the test:
​1. Computed Attributes
​I deleted all custom attributes and created only three clean, native attributes:

fuel (Number): Translates raw analog bytes (io201) from Teltonika to liters.
fuelConsumption (Number): Acts as our cumulative fuel odometer. It aggregates drops in fuel levels but "freezes" (retains the last accumulated value) during refuel events:

prevPosition != null && prevPosition.getAttributes().containsKey("fuelConsumption") ? (fuel != null && prevPosition.getAttributes().containsKey("fuel") && fuel < prevPosition.getDouble("fuel") ? prevPosition.getDouble("fuelConsumption") + (prevPosition.getDouble("fuel") - fuel) : prevPosition.getDouble("fuelConsumption")) : 0

ignition (Boolean):

ignition != null ? ignition : false

Configuration (traccar.xml)
I removed all unverified configuration keys and left only the native ones that allow tracking fuel on standby:

<entry key='processing.computedAttributes.lastAttributes'>true</entry>
<entry key='filter.skipAttributes'>fuel,fuelConsumption,ignition</entry>
<entry key='processing.copyAttributes'>fuel,fuelConsumption</entry>
<entry key='processing.fuel.ignoreIgnitionOff'>false</entry>
<entry key='processing.fuel.speedThreshold'>0.0</entry>

Our Testing Scenario:
We are starting a controlled test with a stationary excavator (0.0 km/h speed, no odometer change):
Initial state: Fuel is at 20L.
Work period: Engine is on (ignition = true), fuel drops from 20L to 9L. Cumulative fuelConsumption should reach 11L.
Refueling: Refueled on the spot back to 19L. Since fuel level increases, fuelConsumption should ignore this and remain frozen at 11L.
Post-refuel work: Fuel drops from 19L to 14L. Cumulative fuelConsumption should aggregate this new drop and reach 16L (11\text{L} + 5\text{L}).
My Question to You:
Since fuelConsumption is now a natively recognized cumulative attribute, can we expect the standard Summary Report to calculate total consumption simply as Final fuelConsumption - Initial fuelConsumption (resulting in 16L), even though a refueling event happened on the spot and the speed was always 0?
Is this JEXL-based accumulation into the official fuelConsumption attribute the recommended architectural way to handle fuel monitoring for stationary machinery in Traccar?

Anton Tananaev 22 days ago

I don't think I can help here. I still see completely hallucinated nonsense that you didn't bother to check yourself, which tells me that my time here is not appreciated.