Create custom attribute to device and add it in a calculated attribute function

Josue4 years ago

Hello good Morning. It is possible to create a custom attribute to a device and add it in a calculated attribute function.

That is: I register an attribute called kmInitial on the device with value 2350

In calculated attribute I create one that works as follows:
totalDistance? (totalDistance - kmInitial): null

Anton Tananaev4 years ago

I think it should be possible.

Josue4 years ago

Should I activate some function in traccar.xml or with that logic would it work?

Anton Tananaev4 years ago

You have to enable "processing.computedAttributes.deviceAttributes" in the config file.

Josue4 years ago

Ok thanks you. It working