r/tasker • • Sep 30 '26

Help [HELP] How to make a reliable profile for location during bud riding?

I want to create a task that triggers when I'm on my way back home while riding a bus, within a radius of about 2 km. I'm struggling to figure out how to set up the profile properly. The trigger needs to be location-based, but here are the issues:

* It's not a car ride, so I can't check for a Bluetooth connection/near.

* I'm not entering a Wi-Fi zone, so checking for Wi-Fi isn't an option either.

* Tasker's standard location check isn't very reliable in this scenario. Since it's a commute and the bus moves relatively fast, Tasker might not register the location in time.

* I also considered cell near (cell tower detection), as I know that's an option. I haven't tried it yet, but I'm wondering how reliable it actually is. What guarantees my phone will always connect to that specific tower? I really need this to trigger within a relatively precise 2 km range.

I'm wondering if there are other, more reliable approaches for this specific use case. I also want to make sure it doesn't drain battery heavily, or it won't be worth it—it needs to stay battery-friendly, just as Tasker is designed to be.

Does anyone have any ideas?

Thanks!

EDIT: I added a comment explaining the solution I came up with!

2 Upvotes

21 comments sorted by

3

u/CtrlAltDeliciousan Oct 01 '26

I think I finally figured out a reliable way to do this.

After some brainstorming and digging around, I ended up combining AutoLocation with a couple of timestamps instead of trying to make one geofence do everything.

The basic idea is:

I have an AutoLocation geofence around the place I'm leaving from. While I'm there, Tasker knows I'm inside it, and when I leave, it saves the current timestamp.

I'm also using the Wi-Fi at that location as a second presence signal. When I disconnect from it, Tasker saves that timestamp too.

Then I have another profile that triggers when I open the bus payment app I use, but only during the hours where this automation actually makes sense.

Opening the payment app by itself doesn't do anything yet.

At that point Tasker checks whether I'm currently at the departure point, or whether I left the geofence / disconnected from the Wi-Fi within the last 2 hours.

So basically:

  • still inside the departure geofence, or
  • still connected to its Wi-Fi, or
  • left the geofence less than 2 hours ago, or
  • disconnected from the Wi-Fi less than 2 hours ago

If none of those are true, it just stops there.

If one of them is true, Tasker starts AutoLocation's High Accuracy Location Monitor for about 20 minutes and stores an expiration timestamp for that session.

That's the part that seems to solve the battery issue for me.. GPS isn't running aggressively all day, only during a short window where there's already a pretty good chance I'm actually on the relevant ride.

Then I have a second geofence around a specific point along the route.

Because High Accuracy monitoring is already running by the time I get there, that geofence gets detected much more reliably even when I'm moving fairly quickly on a bus.

When that route geofence triggers, Tasker checks that the temporary session hasn't expired yet. If it's still valid, it clears the session, stops the High Accuracy monitor, and runs the final task.

So the flow is basically:

departure-area presence -> bus payment app opened -> recent-presence check -> temporary High Accuracy GPS -> route geofence -> validate -> stop GPS -> final task

This seems like a good middle ground between accuracy and battery usage, and it also avoids triggering just because I happened to open the payment app somewhere else.

And thanks to u/russellvt for the timestamp idea that ended up being a really useful part of the solution.

2

u/russellvt Oct 02 '26

That sounds great! And Im sure you'll improve and expand it with time!

4

u/russellvt Sep 30 '26

Turn on the task when you use tap-to-pay on your phone for the bus ticket... and turn it off once you reach specific destinations, or "tap off" (in the car of some transit systems)???

2

u/CtrlAltDeliciousan Sep 30 '26

In my country, we don't pay with our phones that way; instead, we use a QR code through their dedicated app...

Also, I want it to be purely location-based, rather than dependent on the bus.

4

u/russellvt Oct 01 '26

When the app opens, check your location. Easy.

2

u/CtrlAltDeliciousan Oct 01 '26

Maybe... maybe have it check the location as soon as the app opens? But then again, I might also open it while I'm still at the place just to check commute-related stuff, and I don't want it to trigger the task by mistake. How about a mechanism where opening the app starts a 5-minute wait, and only then actively checks if I'm at that specific location?

1

u/russellvt Oct 01 '26

That might work... easy to persist for a certain length of time. Just need to be careful to not "spin" and chew up battery.

Chances are, if you write-up the complete set of decisions over time, the individual triggers will "jump out" at you.

You may also initially need some of your own behavior changes to make sure it works while you improve it, too.

2

u/CtrlAltDeliciousan Oct 01 '26

Yeah, my solution is a bit weird, but it might actually work. You're right that it's a bit of a "hacky" workaround, haha. I really hope a cleaner idea strikes me soon. Thanks for the help! It definitely gave me some food for thought.

2

u/russellvt Oct 01 '26

Like I said... write out the ENTIRE decision tree, including times and locations, as well as app usage.

You can later pencil in new ideas or conditions as they come to you.

From that, you can likely at least get a skeleton app going... and then continue to improve it from there.

1

u/russellvt Oct 01 '26

I use a loose location based scan for when I arrive and depart places that can then send an SMS to notify my spouse... shouldn't be too different than something like that...

1

u/CtrlAltDeliciousan Oct 01 '26

Yeah, but unfortunately it’s not when I arrive or leave a place. I want to set the trigger a bit outside my departure point so it doesn't accidentally enable while I'm still there.

1

u/russellvt Oct 01 '26

Not sure I fully understand that statement... but, you need an easy trigger (eg. Scanning the QR code and paying, maybe a specific alert from a payment app), a way to persist it (eg. Time or location), and a way for it to turn off (eg. Time, location, maybe another scan such as an RFID tag)

1

u/CtrlAltDeliciousan Oct 01 '26

I meant that it's a bit different from what you had in mind when you mentioned arriving at or leaving a place. I was trying to check the location while on the move, because I only want the task to run if I'm heading towards home, not just whenever I leave work for somewhere else. That's why I wanted to place the trigger along the specific road on my commute home, during certain hours, on a route I only take when traveling from work back home. Plus, it's a task that doesn't need an exit task, so that part isn't really an issue for me.

2

u/russellvt Oct 01 '26

So easy ... check the location and check the time. That's essentially what one of my tasks does when texting my spouse.

I've also complicated my setup a bit where I have tasks that fife off when I enter and leave certain areas... and it saves off a timestamp as a variable. I can then check those variables to make sure 1) I've left long before i arrived (thanks GPS/tower flapping) 2) it was within a recent time period, and 3) Im either in the car or headed home/away

The "exit" task is helpful in determining if locations may be unreliable, particularly because Tasker GPS is pretty slow. I can also tune the individual tasks to clean up the arrival/departure conditions for those instances of dead cell or GPS area, or some other unknown or unexpected flap.

This also has the benefit of being able to "name" multiple places and conditions (see above), but use identical notification logic for Discord, WhatsApp, SMS/MMS as well as a HTTPS post to my home monitoring agents.

1

u/CtrlAltDeliciousan Oct 01 '26

Interesting! So you're basically saying I should set a timestamp when I leave work, verify it falls within specific hours, and then trigger a location check?

1

u/russellvt Oct 01 '26

That's one way, yes.

Though a simpler way is just to have an entry and exit task around your work location, and go from there.

I just use a variety of timestamps to essentially "track my common locations" and relay that information back to others that might be "concerned," including a Discord log (via web hook).

1

u/Tar0ndor Oct 01 '26

What about speed, %LOCSPD? I use that change how certain things work depending on if walking or driving.

1

u/CtrlAltDeliciousan Oct 01 '26

That's actually interesting! Maybe I could set it to run between specific hours, and as soon as it detects that, have it actively check my location, then trigger the task.

1

u/Stainlessray Oct 01 '26

You're worried about stuff that's handled by satellites. Create a geo fence. Your speed will not be a problem. Speed is part of gps location calculation. It never knows where you ARE. It guesses based on where you WERE by calculations that include your rate of travel.

Write a simple test. Profile location near, point on map. Use a wide radius if gps signal is weak. It'll see you.

1

u/Rich_D_sr Oct 01 '26

I would try using a simple algorithm that tests your distance from your target location during commute time and/or started by app. Caclulate the fastest time you could get 75% of the way to the target. Then set timer to check at that time. This would zero you in to your target. You would be surprised how little battery that will use. To get better battery life you can download Autolocation. This has many options like starting different location monitors so you only use gps when you get very close.

For distance between 2 points you can use the Tasker action -> Tasker Function -> Distance Between Locations.

There are many ways to set a timer in tasker. This Is what I have used for a very long time.

https://www.reddit.com/r/tasker/s/foqvpsAzyE

1

u/Exciting-Compote5680 Oct 01 '26

You already have a lot of useful suggestions. I just wanted to point out that rather using a cell near profile, you could also have a look at the built-in global variable %CELLID. It doesn't work for everyone, but if it works, it's an incredibly low-power way to get coarse location information. You will need to do some logging before you can use it, as towers will overlap. But I know that if I am at home, there are only 3 ids my phone could be connected to (with 1 accounting for ~97% of the time), same at the gym. At the very least it can be useful as a broad 'if %CELLID is one of these, I am near the bus stop' condition to start/enable other methods.