Issue with Low Battery Alarm in Computed Attributes: Alarm Not Triggering Correctly

Kutta3 months ago

have you a solution?

Anton Tananaev3 months ago

It is definitely possible to do, but I still don't understand why it needs to be done.

Kutta3 months ago

you do not answer my question!
because the alarm does not remain set

Anton Tananaev3 months ago

Sorry, I cannot provide you a full solution because it's pretty complicated.

Kutta3 months ago

I have now found the following solution:
Attribute: alarm
Expression: batteryLevel < 55 && lastBatteryLevel >= 55 ? "lowBattery" : null
Type: string

And add following in the config:

<entry key='processing.computedAttributes.lastAttributes'>true</entry>
Kaldek16 days ago

It's been a while that anybody has updated this thread, but I've just set this up (Low power alarm) on my server for Teltonika devices which don't seem to have a good low power alarm that is configurable on the device (and there is no handling for one in the source code for Teltonika devices in Traccar anyway).

The summary statement here is that the alarm generates and self clears without needing any fancy rules. Here's the Computed Attribute expression that does it for external voltage when it drops below 11 volts. For those of us who are new to Traccar - and I still consider myself in that group - I will note that lowPower is an in-built alarm within Traccar and here we are just using other data from the GPS tracker to trigger this alarm. Depending on your tracker and what the devs have configured in the decoder source code for your tracker vendor, you may need to set up Computed Attributes for all of your alarms.

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

The alarm generates if the voltage drops below 11 volts, and will not re-trigger unless the voltage increases above 12 volts, and then drops below 11 again. This can be visualised in the following device check-ins:

  • Check in #1: Voltage 14 volts (no alarm)
  • Check in #2: Voltage 10.5 volts (generate alarm)
  • Check in #3: Voltage 10.5 volts (no additional alarm generated)
  • Check in #4: Voltage 13.8 volts (alarm cleared)
  • Check in #5: Voltage 10.4 volts (generate alarm)

Note that as per the Traccar decoder for Teltonika in Github (and as per Teltonika Wiki), there is a "power cut" alarm but it's for the internal battery of the tracker which is kind of useless. I mean, under what circumstances would the tracker have been opened, the battery ripped out, and the +12v feed from the vehicle still be connected?