Perpetual Attribute

iottx2 years ago

Hi, i have a device that's send the odometer from can-bus, but it send it only when the vehicle is turned on. I can do something with the computed attributes? or i can put the value on total distance?
Thanks in advance Anton.

Anton Tananaev2 years ago

You can use attributes copying.

Anton Tananaev2 years ago

Something like this:

<entry key='processing.computedAttributes.enable'>true</entry>
<entry key='processing.copyAttributes'>odometer</entry>
iottx2 years ago

Thank you a lot! for odometer and odometer obd attributes, i have to pass data converted in meters or kilometers? or it's the same thing (maybe traccar does some stuffs in the backend with this data) ?

Anton Tananaev2 years ago

It should be in meters.

iottx2 years ago

i added this to traccar.xml and restarted but nothing appened, i still view odometer only when the device sends it. What it can be?

<entry key='processing.computedAttributes.enable'>true</entry>
<entry key='processing.copyAttributes'>odometer, obdOdometer</entry>
Anton Tananaev2 years ago

Have you restarted the service? Please provide screenshots.

iottx2 years ago

yes, i restarted traccar.
Description text

Anton Tananaev2 years ago

I see that last ones have the value. It's also not very clear where you took that screenshot from. Probably full page screenshot would be better.

iottx2 years ago

i took the screenshot from reports page, as you can see the odometer parameters disappear after the device stops sending odometer.
Description text
Description text

Anton Tananaev2 years ago

Try this (no space):

<entry key='processing.copyAttributes'>odometer,obdOdometer</entry>
iottx2 years ago

i have the same issue, it can be the obdOdometer param?

Anton Tananaev2 years ago

Does it work with just one parameter?

Anton Tananaev2 years ago

I just realized that there was a typo in the parameter name. It should be:

<entry key='processing.copyAttributes.enable'>true</entry>
<entry key='processing.copyAttributes'>odometer,obdOdometer</entry>
iottx2 years ago

it's seems the same code to me, but i will try. thank you