Help Please - I receive many messages via WEB and via E-mail of "Alarm On and Alarm Off".

I receive many messages via WEB and via E-mail of "Alarm On and Alarm Off".

Chock Alarm also received a lot, but I decided to reduce the sensitivity of the tracker and solved it, but the alarm on and alarm off comes along with the notifications of the category "Alarm".

My device is: coban 303g
Protocol: gps103

I would like to receive only relevant messages example: powerCut, low battery.

in log

imei:864180035405476,acc on,180614165915,,F,195910.000,A,2101.6091,S,04722.3736,W,0.00,0;
imei:864180035405476,acc off,180614165918,,F,195914.000,A,2101.6078,S,04722.3750,W,0.00,0;
Anton Tananaev6 years ago

You can use computed attributes to filter some types of alarms. Search on forum for more information and examples.

I am try:

alarm ? ( alarm == 'powerCut' || alarm == 'lowBattery' ? alarm : null) : null

However I am getting the messages on and off, both via web and via email.

Did not work.

Anton Tananaev6 years ago

Have you enabled computed attributes for your devices?

Yes, enable.
Computed Attributes and Notifications;

and put the parameters in to traccar.xml :

   <entry key='processing.computedAttributes.enable'>true</entry>
   <entry key='processing.copyAttributes'>power,ignition,battery</entry>

See in mysql:

mysql> select * from device_attribute;
+----------+-------------+
| deviceid | attributeid |
+----------+-------------+
|      163 |          13 |
+----------+-------------+
mysql> select * from attributes;
+----+-------------------+--------+-----------+-------------------------------------------------------------------------------+
| id | description       | type   | attribute | expression                                                                    |
+----+-------------------+--------+-----------+-------------------------------------------------------------------------------+
| 13 | Tratar Os ALarmes | string | alarm     | alarm ? ( alarm == 'powerCut' || alarm == 'lowBattery' ? alarm : null) : null |
+----+-------------------+--------+-----------+-------------------------------------------------------------------------------+
mysql> select * from device_notification;
+----------+----------------+
| deviceid | notificationid |
+----------+----------------+
|      163 |             15 |
+----------+----------------+
mysql> select * from notifications;
+----+-----------------+------------+------+------+------+--------+------------+
| id | type            | attributes | web  | mail | sms  | always | calendarid |
+----+-----------------+------------+------+------+------+--------+------------+
|  1 | alarm           | {}         |     |     |      |       |       NULL |
|  2 | geofenceEnter   | {}         |     |     |      |       |       NULL |
|  3 | geofenceExit    | {}         |     |     |      |       |       NULL |
|  4 | ignitionOn      | {}         |     |     |      |       |       NULL |
|  5 | alarm           | {}         |     |     |      |       |       NULL |
|  6 | deviceOnline    | {}         |     |     |      |       |       NULL |
|  7 | deviceOverspeed | {}         |     |     |      |       |       NULL |
| 15 | alarm           | {}         |     |     |      |        |       NULL |
+----+-----------------+------------+------+------+------+--------+------------+
Anton Tananaev6 years ago

Have you modified it through the database directly?

No, only make select to show to you

Anton Tananaev6 years ago

It should work, unless it's disabled in the config somewhere. I would recommend to create an attribute that's guaranteed to work (e.g. just a string value) and see if it works.

I understood, I'll do it and I'll give you a return if it worked.

when I run the test by the calculated attribute it returns the last alarm correctly, which in my case is the "powerCut".
But he keeps sending me emails when it's "powerOn or powerOff"

I found a problem here with respect to the rule, I will do some more tests and report as soon as I have the results

Anton, i Will test if this rules:

alarm ? ( alarm == 'powerOn' || alarm == 'powerOff' && speed < 1 ? null : alarm) : null

Realy dont work..

I solved doing a filter directly in my email hosting.