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

Josue3 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 Tananaev3 years ago

I think it should be possible.

Josue3 years ago

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

Anton Tananaev3 years ago

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

Josue3 years ago

Ok thanks you. It working