I tried to customize short SMS

Shahzad2 years ago

I added speed, position, google map url in short sms it's working properly. I tried to add total distance to it. But $totaldistance is not showing.

Someone guide me how to add it.

Sms Short Code.

#if($speedUnit == 'kmh')
#set($speedValue = $position.speed * 1.852)
#set($speedString = $numberTool.format("0.0 km/h", $speedValue))
#elseif($speedUnit == 'mph')
#set($speedValue = $position.speed * 1.15078)
#set($speedString = $numberTool.format("0.0 mph", $speedValue))
#else
#set($speedString = $numberTool.format("0.0 kn", $position.speed))
#end

$device.name ignition ON Speed $speedString at $dateTool.format("hh:mm a EEE d MMM yyyy", $event.eventTime, $locale, $timezone) Address: Near $position.address Map Link: https://www.google.com/maps/search/?api=1&query=$position.latitude,$position.longitude Total Distance $totaldistance

Result:

XYZ-123 ignition OFF Speed 0.0 km/h at 05:47 PM Sun 5 Jun 2022 Address: Near Narowal-Muridke Road, Chaura Rajputtan, Punjab, PK Link: https://www.google.com/maps/search/?api=1&query=31.847735555555555,74.29606666666666 Total Distance $totaldistance

Please guide How will it pick up the reading?

Anton Tananaev2 years ago

You can try something like $position.attributes.totalDistance.

Shahzad2 years ago

Thank you.

Shahzad2 years ago
Xyz-123 ignition ON Speed 0.0 km/h at 08:07 PM Mon 6 Jun 2022 Address: https://www.google.com/maps/search/?api=1&query=34.766145,72.35192833333333 Odometer: 1.068589383E7 km Motion: false

How to change the reading format. Its 10687.32 km in the web

Anton Tananaev2 years ago

You need to do something similar to what is done to the speed value.

Shahzad2 years ago

I add line break after device name, speed, time and address. After that the notification stop being sent. If I remove line breaks it's working. What could be the problem?

Anton Tananaev2 years ago

Not sure. Line breaks should work, I think. But text messages have a character limit, so maybe it's related to that?

Shahzad2 years ago

I'm using WhatsApp massage, of course there is no limit.

Oluwatobi2 years ago

@shahzad, Please can we connect? i would like to understand more about whatsapp and telegram interfacing of the tracker app. i hope its okay to drop contact details here. [removed]

Anton Tananaev2 years ago

No, it's not okay. We don't allow sharing of any personal contact information on the forum.