Power OFF Traccar notification

Hi everyone,

I hope everyone is doing good.
I’m using Traccar with some TELTONIKA obd and non obd devices for a long time and I’m very excited!
I wanted to ask how I could make a “traccar” push notification when power of an obd device goes to “0” zero.
I’m getting the voltage when devices are plugged in so I wanted to know when they are unplugged.
Do I have to make any computed attribute or I could only do that by creating a notification.
Thank you in advance.
Mike

Or maybe if I could set a rule like,

If power : 0
Then
Push notification to

Deborah3 years ago

With Teltonika you can use "Unplug detection" directly from the device configurator. You can get an SMS

Thank you for your answer, but I would like to have traccar to provide all the necessary information

Cristian3 years ago

may be something like this:

Calculated attribute

io252==1 ? "Source disconnected":null
io252==0 ? "Source connected":null

Notification

You must create a notification TYPE=Alarm

and in the notification attributes you must add

name=alarms value=Source disconnected

and another notification with:

name=alarms value=Source connected

Remark:
As @nicola says, in the teltonika configurator you must enable the option to unplug the device.

You can improve the calculated attribute by asking if the io252 comes as data.

example

io252 ? (io252 == 1 ? "Source unplugged" : false) : null

This you must test it because I have not used it like this.

I hope it helps

Hi Cristian,

Thank you for your answer, it seems that you are also using Teltonika devices because I see the io252 which is the "unplugged device" id.
For me it seems that the id io252 is not working all the time so I have to handle to external power "Power" so I still struggle to find a right syntax to computed attributes to say let's say that output Power 0 means that the devices is unplugged.
I will read more.

Cristian3 years ago

if you receive the "power" data from teltonika gps

you can configure something like this:

https://ibb.co/cbFq8yK

and then create the traccar power failure alarm notification.

if you don't receive the "power" data you will have to see with the teltonika configurator how to make the gps send it.

you can easily see if you get the "power" data when consulting a route and export it to excel.

Thank you so much Cristian!
I think I made it with the above computed attribute:
Description: Device Unplugged
Attribute: Alarm
Expression: power ? power < 6 : null
Type: String

When I enable this attribute to a device, I can see it right through the Device State as "true" or "false" but I cant figure out how to syntax the notification now...

Cristian3 years ago

https://ibb.co/n60wWYQ
https://ibb.co/X7qTzQx

create the attribute and then create the notification and in the attributes of the notification you must add the image that is together with the notification.

notice that in both cases it says "Potencia Baja".

Cristian it worked!!!
Thank you so much about it, I'll try to figure out how it worked, so I could apply other kind of rules as well.

Thank you once again

Paul Cooksona year ago

Thanks to contributors of this thread, I was able to get this working well with FMC130 and 230.

I wanted to use io252 as our vehicles operate on a multitude of voltages. I found using io252 ? blah blah approach alone did not work. I think this is because io252 == 0 evaluates to false, so not returning the result from the computed attribute on reconnection.

This was my solution.

event ? (event == 252 ? (io252 != null ? (io252 == 1 ? "Source Disconnected" : "Source Connected") : null) : null) : null

I found this takes advantage of the inbuilt unplugged detection and worked reliably.

Special thanks to Christian, how you worked that out, I have no idea!