Notifications for "alarms"

alex2 days ago

Hi all

I am trying to define custom alarms for a few specific scenarios, one example is "low battery voltage".

I am using a Teltonika tracker that reports "power" as a voltage but I cannot figure out how to use this along with Custom Attributes to trigger a Notification.

I popped an update in this thread below, as its pretty close, but I seem to be missing a fundamental part of how traccar notifications work.

https://www.traccar.org/forums/topic/issue-with-low-battery-alarm-in-computed-attributes-alarm-not-triggering-correctly/page/2/

I have tried Up until this point, I had no idea that you had to trigger the built in ALARM_LOW_POWER (or other relevant alarm) as per that thread, the documentation is a bit confusing for me, or essentially misses this out.

Running a test on this:
Screenshot 2025-10-11 131152.png
produces an "lowPower" output as the voltage is 10.5V.

I am unable to get this to trigger a notification though. I have increased the voltage above the trigger (11) and then reduced, but not triggered an event or seen anything in the logs

Any assitance or nudge in the right direction would be much appreciated.

bluelaser2 days ago

Have you created a Notification of the type 'Alarm' with the Alarm of 'Low Power' selected along with a Channel then linked that Notification to the Device or Group?

Cristian2 days ago

You already have the calculated attribute, but
do you have the notification created and assigned to the device?

Anton Tananaev2 days ago

Have you linked this attribute to the device? Do you see the alarm attribute in the position details?

alex2 days ago

To bluelaser + Cristian, I have the following notification assigned to "all devices":

Screenshot 2025-10-11 154801.png

to Anton, I already had a "power" attribute listed under the device, see below:

atrributes.png

Do I need to add the "alarm" attribute manually to the device? I don't see any attribute with the name "alarm" listed already under the device info.

Thanks for your help, I appreciate I am missing something fundemental.

Anton Tananaev2 days ago

You definitely have to link your computed attribute to the device. Have you checked the official documentation first?

alex2 days ago

I have linked the computed attribute to the device by going device>link>and then selected the computed attribute.

This has generated the alert now, apologies, my confusion in the document came from the reference to position:

"Computed attributes are applied to all incoming positions of a linked device. To link, go into settings, open devices or groups page, and click on the link icon. Then select attributes in the dropdown." I now understand that "position" is a frame of data from the tracking device with all attributes and not neccesarily just position information thanks

alexa day ago

The only issue I have now, it only seems to fire one alert.

Having left the device overnight for testing, the movement alert was triggered correctly the next day when prompted.
The low voltage alert was not.

Movement alert syntax:

(motion == true && ignition == false) ? "movement" : null

Low voltage alert syntax

power != null && power < 11 ? "lowPower" : null

When a movement alert has been triggered, then timed out (not showing "ALERT" in the gui), a prompted low voltage alert does not get triggered.

When testing the expression when an alert should have been triggered, it gives the result "lowPower" but the device attribute does not show alarm - Low Power

Anecdotally, it seems if the Position data contains both pieces of information (movement and low voltage) it only triggers one or the other.

any thoughts

Alarm notification is only triggered once per sequence.

alexa day ago

Thanks and is one sequence run over each position event? So if there is a position update from the device once and hour, and the expression applies. It will take 2 hours to trigger both?

Timing doesn't mater. If you keep sending the same alarm in every message, it will trigger notification on the first one only.

alexa day ago

In the above example, voltage has gone above the threshold for 6 position messages then back underneath and not triggered the notification.

I have checked that it's valid at the time by running the test on the expression

alexa day ago

Further testing indicates that the issue is with the : null statement at the end, removing the attribute completely after the first successful switch from matched to unmatched.

Changing to : alarm keeps the attribute present but empty for the next run.