Compute Attribute always return Hard Braking

Primtek4 years ago

Hi..

I use Teltonika FMB001, I set compute attribute as follow:

event == 253 && io253 == 1? "hardAcceleration" : event == 253 && io253 == 2? "hardBraking" : event == 253 && io253 == 3? "hardCornering": null

why it keeps returning "hardBraking"

what I missed?

please help

Primtek4 years ago

and I see this:

 WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute@102![16,21]: 'event == 253 && io253 == 1? 'hardAcceleration' : event == 253 && io253 == 2? 'hardBraking' : event == 253 && io253 == 3? 'hardCornering' : null;' undefined variable io253 - Variable (... < ComputedAttributesHandler:102 < *:113 < BaseDataHandler:27 < ... < *:29 
Andreas Kern3 years ago

Hello,

your syntax is wrong

use this

io253 ?  (io253 == 1 ? "hardAcceleration" :(io253 == 2 ? "hardBraking":(io253 == 3 ? "hardCornering" :null))) : null