Perpetual Attribute

iottx 3 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 Tananaev 3 years ago

You can use attributes copying.

Anton Tananaev 3 years ago

Something like this:

<entry key='processing.computedAttributes.enable'>true</entry>
<entry key='processing.copyAttributes'>odometer</entry>
iottx 3 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 Tananaev 3 years ago

It should be in meters.

iottx 3 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 Tananaev 3 years ago

Have you restarted the service? Please provide screenshots.

iottx 3 years ago

yes, i restarted traccar.
Description text

Anton Tananaev 3 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.

iottx 3 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 Tananaev 3 years ago

Try this (no space):

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

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

Anton Tananaev 3 years ago

Does it work with just one parameter?

Anton Tananaev 3 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>
iottx 3 years ago

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