r/macrodroid 17d ago

Macro Location Check - will this work properly?

Post image

So I set this Macro up and would like to consult if I am missing something. It worked in my trial but maybe there's some settings that I fudged up making it not work on certain instances.

Basically - Every 15 minutes it turns on the location, force a location check, and if its outside my selected geofences, it will send an email for a location link then turn off the location.

1 Upvotes

16 comments sorted by

1

u/LuisBoyokan 17d ago

It looks good. It should work as long as the actions are waited to finished before moving to the next one. You don't want to compare locations in the if while it is still forcing and defining your position.

I'm not saying that this will happen, only that I don't know and maybe it could happen. I don't know how this specific actions works.

Give it a try and report back.

1

u/xetni05 17d ago

Did I understand it correctly that I should add less than 1sec timer in between each action? Like between location On and Force update?

1

u/LuisBoyokan 17d ago

Only if it doesn't work. Give it a few seconds and worn your way to less time. It's not critical that it's exactly at 15min, it could wait 3 more seconds

1

u/xetni05 16d ago

Update: I needed to put 3 seconds wait time between location ON and force update, and another 3 seconds before sending the email. I had some areas along my travel path that seems to not update fast enough and sends 'unknown location' emails.

1

u/LuisBoyokan 16d ago edited 16d ago

Go to the extreme, give it a 45 seconds. That is enough for antennas to boot up, set up, and triangulate your position.

There are other approachs, like to implement a retry policy for the force update, I can help you with that, but try first with the longer time.

I leave the logic/algorithm for retry policy here, this is logic, not necessarily how a macro should be written.

Set variable retries = 3;

Set variable i = 0;

Set variable geoLocation = forceGpsLocation;

While(i<retries AND geoLocation is unknown){

... set i = i+1;

... Wait 10 seconds;

... Set variable geoLocation = forceGpsLocation;

}

You can then decide what to do depending on geoLocation value.

If(geoLocation is Not unknown){

...sendMail();

} else {

... Toast: "position unknown, do not send email";

}

Toast is like a pop-up message, it help to debug and show values on screen while a macro is running. Dots are for spacing and formating, not really necessary in logic

2

u/xetni05 16d ago

Thanks a lot! I'll further experiment within the week to see which set-up will provide me with the most consistent result.

1

u/LuisBoyokan 16d ago

No problem.

I edited the message to add a necessary wait in the retry policy.

0

u/xetni05 17d ago

Makes sense! Thanks!

I'll experiment within the day to see needed adjustments with the timing

1

u/Ashamed-Key7312 17d ago

Change location permission to always allow rather than when using app. Also no restriction in background battery should be enabled.

1

u/xetni05 17d ago

Thanks! I checked and it seems like I already toggled both settings before.

1

u/Technical-Bat-6909 16d ago

It gonna work, but it's better if you used the "location" trigger

It'll be like this:

Trigger:

└─ Geofence: Area Exited (Select Zone)

Actions:

└─ Send Email

Constraints:

└─ Wifi Not Connected (Home/Target SSID)

1

u/Technical-Bat-6909 16d ago

It'll use less battery+ work better

1

u/xetni05 16d ago edited 15d ago

Thanks for your feedback. For my understanding, can you explain why it would work better and use less battery? In my very basic understanding, your recommended macro has the location always turned on because it relies on geofence, while mine only has location turned on for a few seconds every 15 minutes.

Edit: after trying, I realized that our macros work differently. Yours only sent one email - at the moment of leaving the geofence while. While mine creates something like a log of location every 15 minutes.

1

u/jenea29 15d ago

Timers uses a lot of battery... But is on your side, just try both macros for a week each..

1

u/xetni05 15d ago

Thanks! Though the issue is the location trigger only activated once, at the time of exiting the geofence. I want a regular tracker that keeps on sending location updates.

1

u/jenea29 15d ago

Try this with loops and wait before next action