Getting Tasker to recognize the name of my location?

960 views
Skip to first unread message

Andrew Morey

unread,
Oct 29, 2015, 5:51:01 PM10/29/15
to Tasker
I made a map watch face for my Moto 360 using Watch Maker, which has Tasker support. I know that Tasker can "get location" but that's only expressed as coordinates, right? Is there a way to get it to get the name of the town (or wherever) that doesn't involve any kind of scripting?

Rich D

unread,
Oct 29, 2015, 10:03:50 PM10/29/15
to Tasker Google Groups Post


> I made a map watch face for my Moto 360 using Watch Maker, which has Tasker support. I know that Tasker can "get location" but that's only expressed as coordinates, right? Is there a way to get it to get the name of the town (or wherever) that doesn't involve any kind of scripting?

Tasker itself is scripting?

Here is a task that will get the street address.

Get Address With New Api (349)
A1: Get Location [ Source:GPS Timeout (Seconds):100 Continue Task Immediately:Off Keep Tracking:Off ]
A2: HTTP Get [ Server:Port:maps.googleapis.com Path:maps/api/geocode/xml Attributes:latlng=%LOC
sensor=true Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
A3: Variable Set [ Name:%httpd To:%HTTPD Do Maths:Off Append:Off ]
A4: Variable Split [ Name:%httpd Splitter:<formatted_address> Delete Base:Off ]
A5: Variable Split [ Name:%httpd2 Splitter:</formatted_address> Delete Base:Off ]
A6: Variable Set [ Name:%ADDRESS To:%httpd21 Do Maths:Off Append:Off ]
A7: Flash [ Text:%ADDRESS Long:Off ]

Get_Address_With_New_Api.tsk.xml

John Doe

unread,
Oct 30, 2015, 1:23:27 AM10/30/15
to Tasker
GeoTask plugin has actions to transform coordinates into addresses and addresses intyo coordinates (free).

Andrew Morey

unread,
Oct 31, 2015, 4:33:54 AM10/31/15
to Tasker
I suppose it is, but nothing down and dirty. Any way, thanks!

Andrew Morey

unread,
Oct 31, 2015, 4:34:35 AM10/31/15
to Tasker
Nice and easy, thanks!

Dale Smith

unread,
Oct 31, 2015, 11:00:11 AM10/31/15
to Tasker
You can replace the two Tasker variable split actions with just one regex.

A8: Variable Search Replace [ Variable:%httpd Search:(?<=address>).+(?=</format) Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%result Replace Matches:Off Replace With: ]
<save last GPS fix time to local variable>

Dale Smith

unread,
Nov 1, 2015, 9:12:30 AM11/1/15
to Tasker
I couldn't get the above Task to work as shown. Here's another version that seems to work well on my Samsung galaxy S5.

Temp (255)
<returns 37.67858132,-121.89996576 like results>


A1: Get Location [ Source:GPS Timeout (Seconds):100 Continue Task Immediately:Off Keep Tracking:Off ]

<gets a huge amount of location data>
A2: HTTP Get [ Server:Port:http://maps.googleapis.com Path:/maps/api/geocode/xml?latlng=%LOC&sensor=false Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
<Regex that extracts street address from data>
A3: Variable Search Replace [ Variable:%HTTPD Search:(?<=address>).+(?=</format) Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%result Replace Matches:Off Replace With: ]
A4: Flash [ Text:%result1 Long:On ]

Dale Smith

unread,
Nov 1, 2015, 1:05:52 PM11/1/15
to Tasker
Not sure why the first action was grayed out. My final version checks if GPS is enabled and it not calls a AutoInput based Task that turns on the GPS then runs the Task to get the location.
If you don't have AutoInput then you will have to manually or by some other means turn on GPS.  Personally I think AutoInput is the one must have plug-in for Tasker. Hope this helps.

Get Address (254)
    <GPS has to be enabled>
    A1: If [ %GPS ~ on ]
    <returns 37.67858132,-121.89996576 like results>
    A2: Get Location [ Source:GPS Timeout (Seconds):100 Continue Task Immediately:Off Keep Tracking:Off ]
    <gets a huge amount of location data>
    A3: HTTP Get [ Server:Port:http://maps.googleapis.com Path:/maps/api/geocode/xml?latlng=%LOC&sensor=false Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]
    <Regex that extracts street address from data>
    A4: Variable Search Replace [ Variable:%HTTPD Search:(?<=address>).+(?=</format) Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%result Replace Matches:Off Replace With: ]
    A5: Flash [ Text:%result1 Long:On ]
    <GPS not on so turn on and start over>
    A6: Else
    A7: Perform Task [ Name:GPS on Priority:%priority+1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
    A8: Goto [ Type:Action Number Number:1 Label: ]
    A9: End If

Reply all
Reply to author
Forward
0 new messages