AutoNotification Intercept Google Navigation ETA notification

Discussion in 'Guides / Examples / Ideas Forum' started by Alex Snegirov, Oct 15, 2015.

  1. Alex Snegirov

    Alex Snegirov New Member

    Joined:
    Oct 15, 2015
    Messages:
    3
    Likes Received:
    0
    Hi,

    I am trying to intercept ETA from Google Maps notification. From a screenshot bellow, first line with address is %antitle, second line with next turn is %antext, "Exit Navigation" is %anbutton1text.
    But I can't figure out where RTA (remainig time/distance) and ETA (arrival time) lines go... Most variables are not populated...

    Am I not looking into right places or it is not implemented?

    Screenshot_2015-10-14-20-19-49.png
    Alex
     
  2. mother9987

    mother9987 New Member

    Joined:
    Oct 15, 2015
    Messages:
    1
    Likes Received:
    0
    %antextsbig4. Split it with newline and its in %antextsbig43
     
  3. Alex Snegirov

    Alex Snegirov New Member

    Joined:
    Oct 15, 2015
    Messages:
    3
    Likes Received:
    0
    OMG. Thank you very much. I was trying %antextsbig without parenthesis and was puzzled because it was empty.
    I had a breakthrough with my nuub tasked programming and ready to share a nice profile...
    It is to notify predetermined people via SMS of my arrival...
    What it does:
    Once I Google navigate to one of addresses of interest, I send SMS with my ETA to predefined people 35 minutes and 10 minutes before arrival
    1) To my butler before arriving Home (sometimes it is word "Home" and sometimes street address in Google navigate)
    2) To my boss when driving to one of two offices
    3) To my mistress (and my buddy to cover me in case wife's looking for me)

    Feel free to improve, criticize or use

    Alex
     

    Attached Files:

  4. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Thanks from me, too. I had been looking for this info for a couple of weeks.
     
  5. jolerius

    jolerius New Member

    Joined:
    Feb 27, 2015
    Messages:
    1
    Likes Received:
    0
    Your projekt doesn't work. I can't even import it into tasker

    Skickat från min SM-G928F via Tapatalk
     
  6. GeekDragon

    GeekDragon New Member

    Joined:
    May 11, 2015
    Messages:
    1
    Likes Received:
    0
    Hi Alex, great job. I've been thinking about doing something like this for months but hadn't put any effort into it. I'm really only interested in letting my girlfriend know when I'm getting home since I travel a lot so I'm simplified your Task to only one address and using Pushbullet instead of SMS so she'll get the notification on her phone, tablet or PC since she works from home. Thanks again for sharing!
     
  7. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    He provided a profile, not a project. Long press the word "Profiles" in the Tasker interface and you'll get an option to import a profile.
     
  8. Alex Snegirov

    Alex Snegirov New Member

    Joined:
    Oct 15, 2015
    Messages:
    3
    Likes Received:
    0
    Field test showed that profile wouldn't work as designed. Primarily because task dies for various reasons before it gets a chance to enable profile back on. And I wanted to turn it off, to prevent hummering tasker with attempts to run same task over and over again.
    I am trying different approaches now on how to fine tune it
     
  9. Liorfru

    Liorfru New Member

    Joined:
    Feb 9, 2015
    Messages:
    3
    Likes Received:
    1
    Why using the notification when you can just query google maps
    just use HTTP get:
    http://maps.googleapis.com/maps/api/distancematrix/json?origins=%LOC&destinations=%home&sensor=true

    Set %home to any address you like
    %LOC is your current location in tasker

    You will need to extract the duration text field from the result that is stored in %HTTPD
    It looks like this:

    {
    "destination_addresses" : [ "New Jersey, USA" ],
    "origin_addresses" : [ "New York, NY, USA" ],
    "rows" : [
    {
    "elements" : [
    {
    "distance" : {
    "text" : "114 km",
    "value" : 114135
    },
    "duration" : {
    "text" : "1 hour 42 mins",
    "value" : 6103
    },
    "status" : "OK"
    }
    ]
    }
    ],
    "status" : "OK"
    }
     
  10. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
  11. easiuser

    easiuser Member

    Joined:
    Mar 7, 2015
    Messages:
    50
    Likes Received:
    4
    Fairly certain that the free version of the API does not take into account traffic.
     
  12. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I think it does now. From the Google Developers documentation:

    "The traffic_model parameter may only be specified for requests where the travel mode is driving, and where the request includes a departure_time, and only if the request includes an API key or a Google Maps APIs Premium Plan client ID."

    Sounds like it works with the free API key, but I haven't tried it.
     
  13. easiuser

    easiuser Member

    Joined:
    Mar 7, 2015
    Messages:
    50
    Likes Received:
    4
    That would be good news. Thought they took it away couple of years ago.
     
  14. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    You're right, but I believe I read somewhere else that it had been restored. The docs do seem to suggest that it's available without a premium plan.
     
  15. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Just tried querying the DistanceMatrix API with my free Google Developers key and I can confirm that it does indeed support reporting traffic effects. All you need to do is supply a "departure_time" parameter (which can be "now") and a "traffic_model" parameter (optimistic, pessimistic, or best_guess). If those two entries are present in the query, you get an additional data block in the xml returned that looks like this:
    <duration_in_traffic>
    <value>9664</value>
    <text>2 hours 41 mins</text>
    </duration_in_traffic>

    (Actually, the "traffic_model" can be left out and it will default to "best_guess").

    That's in addition to also receiving the normal "duration" block" that looks like this:
    <duration>
    <value>9513</value>
    <text>2 hours 39 mins</text>
    </duration>
     
    stanguay likes this.

Share This Page