Calculated attribute alarms are not working for me

juangavilla3 months ago

Hello

I was using Traccar version 6.1 and I upgraded to the latest version Traccar 6.4.
I have a problem that I have already looked at in many places to solve and I can't find a solution.
The alarms that I had created as calculated attributes are not working. Is this happening to anyone else or am I doing something wrong?
I use FMB920 from teltonika and here are two examples of two that don't work

Example1:

event == 246  ? "tow" : null

Example 2:

event == 240 && ignition == false ? "vibration" : null

Before doing the update, they all worked and sent me a notification.
I already verified that the event arrived at the platform from the device.
I have tried different events on my device and on different devices, and I have already checked the templates and everything seems correct.

Only the Event type notifications work for me but not for any Alarm type with calculated attributes.

Btw all the calculated attributes and alarms are linked to the device.

Thank you!

Anton Tananaev3 months ago
  1. Do you see the source attributes that you're using?
  2. What results do you get when you test this using the computed attributes test option?
  3. If testing works, do you see the right alarm value in the position?
juangavilla3 months ago

Let me show you
1: The server receives the event 246
1.png

2: The test works
2.png

3: The alarm is already configured
3.png

4: I don't receive the alarm, it's not activated, nothing happens.

Anton Tananaev3 months ago
  1. You haven't provided a screenshot showing all attributes of the device. Your first screenshot doesn't actually make any sense to me because you're not using either status or io246 in your calculation, so those are completely irrelevant.
  2. Have you checked the events report to see if the event is actually generated?
  3. Have you checked logs to see if there are errors?
juangavilla3 months ago

Hello
Yes, I have checked the reports and the logs are ok.

I think I found where the problem is.

If my device is paired with only one calculated attribute alarm, for example Towing, the alarm works.
If I have my device paired with two different calculated attribute alarms, for example Towing and Vibration, one stops working.

I think it's the new Priority feature, but I can't figure out how one doesn't cancel the other.

Anton Tananaev3 months ago

If you want to use multiple instances of computed attribute for the same attribute, then your expression is completely wrong. Instead of null, you should return the original value of the alarm.

juangavilla3 months ago

Solved!

Thank you!!

How did you solve it?

juangavilla3 months ago
event == 240 && ignition == false ? "vibration" : alarm

instead of

event == 240 && ignition == false ? "vibration" : null

I changed the word null to alarm

:)

I can't get the alarm to work, even though it's set.

1000130104.png

Ayuda por favor.

juangavilla3 months ago

Hello

Don't use the translated word "VibraciĆ³n", use the original word of the alarm "vibration"
///
No uses la palabra traducida "VibraciĆ³n", usa la palabra original de la alarma "vibration"

Anton Tananaev3 months ago

The error is telling you that the alarm variable is missing. You need to add a check for it.

Thank you for the prompt response colleagues.
Anton, thank you very much for your answer, but tell me I don't understand how How to generate the alarm variable?

Anton Tananaev3 months ago

The problem is with your fallback value.

Andres Petrilloa month ago

The same thing happened to me after upgrading from 5.8 to 6.4.
If you are using Computed Attributes, to create an ALARM, and that attribute is missing (Example: eventual IO attributes in Teltonika) using something like:

io318 ? io318 == 1 : null

In the case you don't get the io318 in that specific position, the Computed attribute, will REMOVE the alarm attribute, and will prevent any other alarm event to happen.

SCR-20241021-jaml.png

The workaround, is to return the original ALARM attribute instead of the null as we used in the PAST.

Old way:

io318 ? io318 == 1 : null

New way:

io318 ? io318 == 1 : (alarm ? alarm : null)

SCR-20241021-jbvx.png