Custom event for custom attribute

Agile Hobo7 years ago

I want to raise a custom event when the data from device has a custom attribute. If the "attributes" doesn't contain that custom attribute, the event will not be fired. Then the event will be forwarded to another application.

Is it possible to do it with Traccar? Can I address it by using dynamic handler as I don't want to change Traccar's source code?

Thank you very much.

Anton Tananaev7 years ago

You don't even need dynamic handler. You can probably just use computed attributes for it.

Agile Hobo7 years ago

Thank you, Anton.

But how to implement a custom event for Traccar? As I read here, Traccar is limited to 9 categories (as described in https://www.traccar.org/documentation/events/). If I can't or don't need to implement a custom event, which one should I use?

Here is my problem in details: My devices have several events which come with a pair. Example: Do A/Stop do A, Do B/Stop do B. They will be sent to Traccar as a custom attribute's value. I need to collect these events to produce event logs (together with GPS location). How should I implement it? Please give me an advice on it. Thank you very much.

Anton Tananaev7 years ago

You can use alarm event. It's basically a generic type for all device-generated events.

Agile Hobo7 years ago

Thanks again, Anton.

Please help to correct me if I'm wrong.

As my devices send custom attribute to Traccar, it means I need to implement/change the decoder to parse this custom attribute. I don't want to change Traccar source code so can I "outsource" the parsing process for this attribute (something similar to dynamic handler)? Thank you very much.

Anton Tananaev7 years ago

You can convert custom attribute into an alarm event.