Modify Template Short SMS to add position string Google Maps

Luis Miguel 4 years ago

Hello greetings how are you, I am using Traccar version 4.14, I have configured the SMS notifications by Twilio, is it possible to add in the Template short SMS Notifications a string with the position of the device?

Example: deviceOnline.vm

$device.name online at $dateTool.format("YYYYY-MM-dd HH:mm:ss", $event.eventTime, $locale, $timezone)

Point:

"www.google.com/maps/place/" + $position.latitude + "," + $position.longitude.

Is this possible?

I tried and the sms message does not do the replacement of the $position.latitude and $position.longitude variables.

What am I doing wrong?

I wish you could help me, thank you for your time, thank you very much.

Anton Tananaev4 years ago

Which template have you tried?

Luis Miguel 4 years ago

Hi Anton how are you? thanks for your attention.
I did the test with the deviceOnline.vm template and modified its content in this simple way.

$device.name is Online $dateTool.format("YYYYY-MM-dd HH:mm:ss", $event.eventTime, $locale, $timezone)

Current Position:

https://www.google.com.mx/maps/@ $position.latitude,-$position.longitude,46m/data=!3m1!1
Luis Miguel 4 years ago

A Calculated Attribute can be attached to the SMS message body.

For example:

Generate a power on notification and assign the Calculated Attribute in turn that the SMS notification integrates that Calculated Attribute.

I don't know if I understood...

Anton Tananaev4 years ago

Position is only available for events that are generated based on positions. Status events are not, so that's why it's not available.

Luis Miguel 4 years ago

Thanks for your answer anton, I will try using a motion event.