add attribute belt on/off for Megastek MT-60X

ph5734 years ago

Hey, great job you are doing at traccar.

I'am trying to add an attribute for monitoring belt on/off for Megastek MT-60X gps tracker. So far I added:

Description: BeltOff
Alarm
alarm == "beltoff" ? false : null
Typ: String

Getting a warning undefined variable:

WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute@102![0,5]: 'alarm == 'beltoff'? false : null;' undefined variable alarm - Variable (... < ComputedAttributesHandler:102 < *:113 < BaseDataHandler:27 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < ExtendedObjectDecoder:64 < ...)

Some hints said to use event instead of alarm, but same warning coming up:

Description: BeltOn
Event
event == "belton" ? true : null
Typ: String

WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute@102![0,5]: 'event == 'belton'? true : null;' undefined variable event - Variable (... < ComputedAttributesHandler:102 < *:113 < BaseDataHandler:27 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < ExtendedObjectDecoder:64 < ...)

Any hints for me? Highly appreciated, thank you!

Anton Tananaev4 years ago

I think the error is pretty self-explanatory. The attribute you are trying to use is missing.