Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dotnet

macrumors 68000
Original poster
Apr 10, 2015
1,745
1,525
Sydney, Australia
I'd like to run an automation when both of two trigger conditions are met, for example a time and a location. The obvious solution, using a location trigger with added time interval, reads like what I want:
"When I arrive at <location> between 10:00 and 12:00, <do stuff>"

However, the automation runs every day at 10:00 regardless of my location. Is there a way of combining location and time triggers with an AND?
 
Could you make it just a location trigger that will only work between those hours? I have an automation with a shortcut that will activate and do nothing if not within the time window.
 
  • Like
Reactions: dotnet
Could you make it just a location trigger that will only work between those hours? I have an automation with a shortcut that will activate and do nothing if not within the time window.

That's what I did.

Personal Automation > Arrive > Choose location > Time Range > Select Start/End times > Run Immediately > New Blank Automation > Controls > Set Focus.

It runs at the specified start time, regardless of location.
 
That doesn't sound right. That trigger should be doing an "AND" behind the scenes already...and only run when you arrive at that location between the times specified.
  • Is your phone the device that determines your location? Check the 'Me' tab in Find My.
  • Does "Alerts & Shortcuts Automations" (found under Location Services -> System Services) have location services enabled?
  • You don't have another duplicate automation that runs every day at 10:00, do you?

Otherwise, if you still can't get it to work, you would have to pick one of the trigger conditions and build out the second one yourself.

For example:
  • When I arrive at <location> (any time)
    • Do: get current time and use IF statements to check if it's between the time range you want.
      • If true, do the rest of the stuff; if false, end.
  • Run every day at 11:00
    • Do: get distance between current location and other location.
      • If less than 0.1km, do the rest of the stuff; if not, end.
However, this is extra work, and both of these still may not work correctly if you can't figure out why your original one isn't working as expected. FWIW, I have some "When I arrive at <location> between times" automations, and they seem to be working fine for me.
 
  • Is your phone the device that determines your location? Check the 'Me' tab in Find My.

Yes, "This iPhone and mobile data Apple Watches", all of which are with me and not at the location in question (which is about 100km away).

  • Does "Alerts & Shortcuts Automations" (found under Location Services -> System Services) have location services enabled?

Yes.

  • You don't have another duplicate automation that runs every day at 10:00, do you?

No.

Otherwise, if you still can't get it to work, you would have to pick one of the trigger conditions and build out the second one yourself.

I'll give that a try, thanks.
 
That's what I did.

Personal Automation > Arrive > Choose location > Time Range > Select Start/End times > Run Immediately > New Blank Automation > Controls > Set Focus.

It runs at the specified start time, regardless of location.
Yeah I wasn't very clear. I was trying to ask if it was possible to change the automation to be location triggered without the time and then making the time window part of the shortcut as BigBlur suggested. Good luck.
 
  • Like
Reactions: dotnet
  • You don't have another duplicate automation that runs every day at 10:00, do you?

You were actually onto something there. I don't have another automation that runs at the time, but the action for the automation is to set a particular focus mode. Turns out, that focus still had a schedule attached to it from fiddling around earlier.

With that gone, all I have to do is test whether the automation actually triggers next time I arrive at the location during the specified time 🙂
 
  • Like
Reactions: Paddle1 and BigBlur
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.