Fuel used by day (based on hours moteur) on summary

VladimirXav 21 days ago

Hi

I want to calculate fuel consumption in liters per hour, in order to display in the daily report the fuel consumed over a 24-hour day. I don’t have a fuel level sensor; I only know that the vehicle consumes 3 liters per hour of operation.
I already have the information about the number of hours the vehicle operates per day.

Thank you in advance

Anton Tananaev 21 days ago

You can add a computed attribute for it.

VladimirXav 21 days ago

Alright, but which attribute should I use?
fuel, fuelUsed, or fuelConsumption?

10000000 - ((hours / 3600) * 3)

Anton Tananaev 21 days ago

It sounds like fuelUsed is more appropriate in your case. Then you can just do (hours / 3600) * 3.

VladimirXav 21 days ago

Alright, thanks — I’ll test that.

VladimirXav 20 days ago

Hi Anton,
I have nothing in the summary with this formule
Conso tracteur fuelUsed (hours / 3600) * 3
Capture d’écran 2026-04-09 à 08.06.32.png

Anton Tananaev 20 days ago

You should first check positions.

VladimirXav 20 days ago

Ok, like this ?

(hours != null && hours > 0 ? (hours / 3600) * 3 : 0)

Is the calculation retroactive ?

Anton Tananaev 20 days ago

No, it's not retroactive. You should probably do:

hours ? (hours / 3600) * 3 : 0