Set initial mileage for device

Bulli4 years ago

Hi

is it possible to set an initial mileage for a device? The actual mileage in reports seems to be calculated as sum of "course" from tc_positions.
I tried to set a value in an early record, but it seems to have no effect.
Where is the total mileage stored?

thanks
Georg

Anton Tananaev4 years ago

Are you talking about "total distance" or "odometer"?

Also, this makes no sense to me:

mileage in reports seems to be calculated as sum of "course"

How is "course" related to distance?

Bulli4 years ago

I want to "manipulate" the odometer reported in the trip-report ("Kilometerstand"). The only column in the database tables I found that relates to this report-column seems to be tc_positions.course. A query brings same value as the report.
Or is it possible to assign an attribute to the device?

Anton Tananaev4 years ago

How is it relates?

Bulli4 years ago

I don't know, sorry. I have not really an idea of java, so I'm not able to lookup how the reports are generated.
But databases I know, so I found that
select deviceid , sum(course) from tc_positions group by deviceid
shows excactly the value of current "odometer end".
So my thought was, that the column "odometer" is calculated that way.
I startet tracking my car with an odometer showing about 155.000 km, so I want to set this as initial odometer start to the device.

Sorry, my english is not perfect, maybe I can't explain good what I mean.

Anton Tananaev4 years ago

First of all, you have to figure out if the value is odometer or total distance.

Bulli4 years ago

I create a report "trip"
I get the columns
Device Name, Start Time, Odometer Start, Start Address, End Time, Odometer End, End Address, Distance, ...

The value of Column Distance is correct as reported by the device, but Odometer Start and Odometer End are about 12.000 km. This is what the device reported as total distance since the traccar server was set up.
I want those columns to show total distance + 155.000 km, because that was initial odometer rate.

Bulli4 years ago

The device itself doesn't report odometer-values.

Anton Tananaev4 years ago

OK, then it means you are using "total distance" calculated on the server. There is an option to set it from devices tables. There should be an "accumulators" button in the settings menu there. It might only be available for admins and managers though.

Bulli4 years ago

Ah, thank you, that (nearly) works. In the german translation "Akku" is not good, that's why I didn't find this. Better would be "Zählerstände".
Is this value stored in the database? I can't find it anywhere.
And is it possible to set a specific timestamp for the accumulatorvalues, so that the "odometer start" is increased instead of just "odometer end"?

Thanks a lot.

Anton Tananaev4 years ago

If there's something wrong with translation, you can help us here:

https://www.transifex.com/traccar/traccar/dashboard/

As for the attribute, it's stored as "totalDistance" in the position attributes in the database.

Bulli4 years ago

OK, made some corrections to german translation.
I'll have a look at the position attributes, thanks.