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

VladimirXav 13 hours 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 8 hours ago

You can add a computed attribute for it.

VladimirXav 8 hours ago

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

10000000 - ((hours / 3600) * 3)

Anton Tananaev 8 hours ago

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

VladimirXav 7 hours ago

Alright, thanks — I’ll test that.