AutoNotification Problem with Google Maps Notification

Discussion in 'AutoApps' started by MikeW, Sep 11, 2015.

  1. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Until I updated to the latest version of the OS, I had been using AutoNotification to scrape the estimated time of arrival and distance to destination from the Maps navigation notification and display it on the screen.

    Now, however, something has changed. That information is still in the notification, but AutoNotification can't seem to see it.

    The notification now has a line that tells what your next turn should be, and under that is the information I want. AN can see the turn info, but not the ETA. Previously, the ETA data had been stored in %antext, but now that just has that first directional line.

    I've tried (I think) all the possible AN variables, but the ETA just doesn't show up anywhere.

    Is there any other way to grab this info and get it into Tasker, or is this maybe a case where AN needs an update?

    Thanks for any help.
     
  2. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I've been doing some testing and found something else odd. It appears that AN can actually see the text I'm after, but doesn't seem to put it into any variable that I can get at.

    I've set up a simple task using the AN Query action. At this point, all I'm doing is flashing the variables, looking for the text I want.

    The data block I'm trying to get always includes the word "estimated" (as in "estimated arrival at..."). If I add a text filter using the "Any" option and put in the word "estimated", variables such as %antitle and %antext will be populated. But if I put in some random word (like "truck") the variables aren't set because none of the fields contain that word. So it seems that there is a field being read that has the data I want. I just can't figure out how to access it.
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
  4. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I did try %ansubtext, but it doesn't seem to contain anything. (variable remains unset). I wasn't a beta tester before, but I've signed up for it now.
     
  5. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    At this point, I'm sure it's related to the OS. In addition to my Nexus 7, I also have a DragonTouch M7 tablet. Both of these have version 9.14.0 of Maps, but the DragonTouch is on version 4.4.2 of the OS and the Nexus is on 5.1.1

    AN can properly read all the data on the DragonTouch, but the same code fails to get the ETA information when run on the Nexus.

    To cross-check, I also ran NotificationListener and found that it couldn't read the ETA data on the Nexus either.
     
  6. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I should also mention that I did try setting "Get All Fields" and checking %antexts(). However, that didn't have the ETA information either.
     
  7. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Well, I've found another way to get this information, but it isn't as clean and simple as just reading the notification, so I'd still like to know if this can be fixed.

    It makes me wonder if I'll run into other notifications that can't be read.
     
  8. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    AutoNotification seems badly broken under 5.1.1

    I was trying to a simple intercept of the Weather Channel persistent notification, so I set up a State profile and chose AN Intercept. If I try to fill from an existing notification, the popup list is empty (if I try that with an Event AN Intercept, the popup doesn't even appear).

    Even manually specifying a package or app name doesn't work.

    Same steps on 4.4.2 work fine.
     
  9. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    My fault. Somehow all my notification access settings got turned off. I'm able to capture the weather channel notification
     
  10. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Just wanted to check in to see if you had any insight on the Google Maps notification issue.

    Thanks.
     
  11. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Problem solved. Found in another thread that this info can be split out from %antextsbig4.
     
  12. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    It's just an Event profile with AutoNotifcation Intercept as the handler. It's set to get both Created and Persistent notifications where the app name is "Maps" and "Get All Fields" is set to true. The data you want is in %antextsbig4 (if you're on Lollipop). The entry task defines a local variable (%ret) to be the Return character and uses that to split %antextsbig4. The resulting %antextsbig43 is then split with ")" [no quotes] and %antextsbig44 is split with the word "at". The final variable, which I display on the screen, is made as follows:

    %antextsbig431)
    ETA: %antextsbig443

    and looks like this:
    2 hr 5 min (137 mi)
    ETA: 2:01 PM
     
  13. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    This might make it a bit clearer; Here's the actual code description from Tasker:

    Profile: V3_ETAScrape (109)
    Cooldown: 30
    Event: AutoNotification Intercept [ Configuration:Event Behaviour: true
    Persistency Type: Both
    Notification Apps: Maps
    Get All Fields : true ]
    State: Variable Value [ %V3_DrivingMode Set ]
    Enter: V3_NotificationQuery (102)
    A1: Variable Set [ Name:%ret To:
    Do Maths:Off Append:Off ]
    A2: Variable Split [ Name:%antextsbig4 Splitter:%ret Delete Base:Off ]
    A3: Variable Split [ Name:%antextsbig43 Splitter: ) Delete Base:Off ]
    A4: Variable Split [ Name:%antextsbig44 Splitter:at Delete Base:Off ]
    A5: Variable Set [ Name:%V3_ETA To:%antextsbig431)
    ETA: %antextsbig443 Do Maths:Off Append:Off ]

    A couple of things to note:
    1) I've set a 30-second Cooldown on the profile so that it doesn't keep constantly firing. You can lower or eliminate that if you want greater granularity.
    2) I have a second context on my profile (State: Variable Value [ %V3_DrivingMode Set ]) that you wouldn't need. I just use that to make sure that the profile can only fire when my Digital Dash system is active. %V3_DrivingMode is the master flag that gets set when the system activates; virtually all the profiles in the system have that additional context so they don't activate unless I'm actually driving.
    3) Since you can't enter a Return directly in Tasker's Variable Split function I set the %ret variable by entering the Return there. It just doesn't show up that way in the code description export.
     
    Bunkerhill Bandit likes this.
  14. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Bunkerhill Bandit likes this.
  15. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    The latest update to Google Maps changed the notification layout again. ETA info is now in %antextsbig3. They also changed the way you start/stop voice navigation.

    I do wish they leave it alone for awhile; I'm getting tired of reworking my code every time they update.
     
    easiuser likes this.
  16. SolitonRadar

    SolitonRadar New Member

    Joined:
    Apr 24, 2016
    Messages:
    2
    Likes Received:
    0
    MikeW, can you give some insight into this?
    The latest version of Google Maps that was installed, 9.23.1, has completely broken my task. I parsed all variables from the Maps notification in tasker and dumped it to a file so that I could see what AN can see. None of the variables show ETA, destination, etc. I am using AN to look at both types of notifications and the notification app Maps. Am I missing something here?
    Any help is appreciated!
     
  17. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I have a DragonTouch M7 tablet with the same version of Maps on it, and for me, the ETA info is contained in %antextsbig3
    I have "Get All Fields" checked and and am checking for both Persistent and Non-Persistent notifications.
     
  18. SolitonRadar

    SolitonRadar New Member

    Joined:
    Apr 24, 2016
    Messages:
    2
    Likes Received:
    0
    MikeW, thanks for the information! Using %antextsbig3 worked. I forgot to parse the sub variables. I was previously using %antextbig4, but since the notification change it stopped working. It no longer lists the destination, either. Bummer. I use this as part of an automated text response system when driving to relay my location and ETA to people who request it. At least ETA is still there which will remain useful. Thanks again for your help.
     
  19. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I'm happy to help. Glad you got it working.
     

Share This Page