So it looks like the problem if you are using Android Pie is that Geofence Monitoring is very slow or asleep regardless of turning off all battery optimizations.I was going to email the creator of the app to see what they think might be the issue. In the meantime I found a solution that works every time. I created a new profile that starts Location monitor when my phone connects to my car’s Bluetooth with an update type of Balanced / Accuracy and an interval of 15 seconds. You can adjust the interval time based on the travel time between your Home Location boundary and your Home boundary.
Here’s some info on the difference between Geofence and Location monitoring:
What’s the difference between the “Geofence Monitor”, the “Location Monitor” and the built-in Tasker location condition?
The Google Fuse Location monitor powers both my “Geofence Monitor” and “Location Monitor”.
The “Geofence Monitor” doesn’t use your GPS. It uses other location data like wifi networks or cell towers. It’s designed to be a low power monitoring mode with the sole purpose of knowing if you’re inside a geofence or not. My guess (there’s no description about it on the developer API) is that it uses the equivalent of the “Balance Power/Accuracy” mode in the “Location Monitor”
The “Location Monitor” may or may not use GPS (or even any power at all) depending on what setting you use in the “Update Type” setting in Tasker. The purpose of this is to find out the latitude and longitude of your location.
The Tasker built-in method uses Tasker’s developer’s own algorithm to find out if you’re in a given geofence. The difference here is that it doesn’t use the Fuse Location monitor to do this.
Before you create the Bluetooth profile make sure you have already paired your phone with car.
1 ) While in the profiles tab of tasker, hit the + button at the bottom right .
2) Select “State” from the box.
3) select “Net” from the next box
4) Select “BT Connected” from the next box
5) At the next selection screen where it says “Name” hit the search icon over to the right. You should see your car’s bluetooth listed. Select your car. It should now be listed in the “Name” area. If its not listed there then you didn’t already pair the device. Go back and do that first.
6) Hit the back arrow at the top left. This will return you to the profiles tab but a new window will open and you want to select “New Task +”. Another box will open with a check mark. Just hit the check mark. You don’t need to fill in anything.
7) You should now be at the Task Edit" screen
8) at the bottom right hit the + button
9) At the next window select “plugin” and then at the next window select “Autolocation”
10) At the next window select “Location”
11) You should be at the Action Edit screen. Look for the word Configuration and hit the pencil over to the right.
12) Now you are in the Autolocation plugin. Select “Location Monitor” and then “Start”.
13) Select Update Type and hit Balance Power / Accuracy
14)Select Interval and enter 15.
15) then hit the check mark at the top right to save your selection
16)This takes you back to Tasker and the Action Edit Screen. Hit the back arrow at the top left. And do it again to get out of the Task Edit Screen.
17) You should be back at the Tasker Profiles screen. Now hit the check mark at the top right.
18) You are done. Drive around and test it out.
Got this from the Tasker Dev regarding the problem with Pie
" This may be related to Android Pie’s Location Limits unfortunately. Since Geofences monitoring is controlled by the system, they get to decide how often to check them, and I’m guessing that they now check less frequently.
The workaround would be what you did: manually turn on location monitoring… Sorry, wish I could help"
Sorry to report that the solution I mentioned above has not consistently worked in triggering when I enter the geofence, even when driving with navigation active (Google maps) to hopefully help poll my location more frequently. It has worked about 2/15 times since posting this a week ago.
leaving the geofence still is working perfectly. Too bad we can’t get this figured out.
How responsive is this when entering the home geofence? I primarily use this to open a garage door, so latency is important. My preexisting setup from above is pretty responsive generally, but even w/ persistent notifications, sometimes autolocation is not responsive enough to trigger the location monitor in time (and i have like a 3k location service radius). I guess I’m just not sure how often & precise the location is when doing balanced at a 15 second interval. Also, I figured that a cron job running every 15 seconds would be somewhat battery-draining if it’s going the entire time while connected to BT on a drive. I’m going to try your ideas out myself after saving my current tasker config. Thanks for the tip. I’ll report back with my findings as well!
15 seconds works for me and It’s very responsive. It will always trigger the Home Arrival Boundary. You may need to adjust the time depending upon how early upon your arrival do you want the garage door to be opened. My garage door is triggered about 1 1/2 blocks from my house. I wouldn’t worry about the 15 second time period . I had it once running for about 2 hours and I didn’t see any real battery drain.
I use a series of boundaries to increase update frequency as I get closer to home. I set AutoLocation to High Accuracy upon entering the 1500m boundary and increase the frequency of updates at 500m. My arrival boundary is about 150m out and my garage invariably completes opening a few seconds before I hit the driveway.
You can add an expiration time for the updates so that if you enter the 1500m boundary, but don’t actually go home, accuracy reverts to a more balanced (power-saving) level.
On newer android devices, the key to overcoming the location services lag, is using something besides location services to trigger High Accuracy location, if that makes sense. The suggestion by @Jack_R would work very well, with the limitation of having to be in your own vehicle. I’ve added a Near Cell profile and used tasker to add the cell towers close to my home. This profile turns on high accuracy location, which then picks up my near home profile on geofence enter, which then increases the sampling for the high accuracy location sensor, and so on. It works every single time. There’s no vehicle limitation, or any other downside that I have found.
Since Location Services already uses cell tower information to estimate your location in the absence of GPS, there is a bit of redundancy to this approach. You should be able to achieve much the same result by increasing the frequency of updates as you approach your destination, then enabling High Accuracy when appropriate. This is not meant to be a criticism of the idea, as more often than not redundancy is a good thing, especially when it works for you.
My only caution on this is that, at least in my area, cell towers are frequently added, upgraded, and moved, and as a result cell tower IDs are forever a moving target. I used them for a while, then decided it wasn’t worth chasing them.
Completely agree. The success of this approach will definitely depend on the area you’re in. In my situation at least, the cell tower population is static, at least for now, so it should work for some time.
I think the main idea to take from this is the method, not necessarily the implementation. With the latest Android versions, battery management makes location services unreliable at best. You can disable battery management entirely, but that seems to have a large negative effect on battery life. So the solution in my opinion is to find a way to trigger high accuracy location services via some other method. Bluetooth connection to the car, near cell, and I’m sure a few other methods that are available. The specific method may vary based on the case at hand, but I think if you follow the idea, you’ll get there.
I tried the cell tower method but it didn’t seem to work for me. I used the “Cell Near” profile and checked the “New Cell API” in preferences. I scanned the towers around me (there were 3). But the triggering of the cells was too slow. Must be the same reason as described by bthrock. Think I’ll stick with my Bluetooth method.
When I did the first scan from inside my home, it only came up with 1 tower, and it didn’t pick up soon enough, as you’ve said. The next time I was in the car with someone else, I had tasker opened and watched the profile. As soon as it deactivated, I opened it and scanned for towers, and added them. I did this in both directions from my house. In my case, I ended up with 3 additional towers in one direction, and 4 in the other, for a total of 8. So now, the near cell profile activates about 1 mile out from my home, in either direction. I probably could remove a couple of the towers and trim the distance down, but it really has no negative effect, and it works so well in its current state, that I’m not going to mess with it.
I have “use new cell API” unchecked. The help tip says that option is device dependent. I have a Galaxy S8 and have not had any issues, so I have not enabled it. I also have “Cell workaround” and “New/Cell Wake Screen” unchecked.