Entry in a GPS area

PantheraSyv

New member
Hello,
I would like to run a macro which tests an entry in a gps area.
But I don't want this macro to run all the time.
For example, I would like this macro to be launched only when I am connected by bluetooth to my car.
Is it possible ?
I had tried to make a first macro which is launched upon connection to the car and which called another macro which had as a trigger the entry into a zone. But it never worked out the way I wanted.
 

Pseudocyclic

Well-known member
I had tried to make a first macro which is launched upon connection to the car and which called another macro which had as a trigger the entry into a zone. But it never worked out the way I wanted.
You will need to add a mechanism whereby your first macro waits for your another macro to be invoked. Try this (untested):

GPS macro...

T: GPS area trigger
A: store location test result to global variable (eg 1,2,3 etc)

BT macro...

T: BT connected
T: BT disconnected
T: MacroDroid variable change -- global variable != 0
A: if trigger fired = BT connected
A: set global variable = 0
A: enable GPS macro
A: force location update
A: else
A: disable GPS macro
A: end if
 
Last edited:

PantheraSyv

New member
Vous devrez ajouter un mécanisme par lequel votre première macro attend que votre autre macro soit appelée. Essayez ceci (non testé):

Macro GPS ...

T: déclencheur de zone GPS
A: stocker le résultat du test d'emplacement dans une variable globale (par exemple 1, 2, 3, etc.)

Macro BT ...

T: BT connecté
T: BT déconnecté
T: changement de variable MacroDroid - variable globale! = 0
A: si le déclencheur est déclenché = BT connecté
A: définir la variable globale = 0
A: activer la macro GPS
A: autre
A: désactiver la macro GPS
A: fin si
Bonne idée. Je n'avais pas pensé à cette option pour activer ou non une macro. je vais essayer
 

Pseudocyclic

Well-known member
Afterthought - I have added a "force location update" action - it may or may not help, but either way it shouldn't hurt to try. You can also make use of the Set Location Update Rate action - however both of these actions appear to control ony what MacroDroid requests, and not how Android chooses to respond.

A good way (possibly the best way?) to get more timely location updates seems to be to have Google Maps running at the same time.
 
Last edited:

PantheraSyv

New member
Après réflexion - j'ai ajouté une action "forcer la mise à jour de l'emplacement" - cela peut ou non aider, mais dans tous les cas, cela ne devrait pas faire de mal d'essayer. Vous pouvez également utiliser l'action Définir le taux de mise à jour de l'emplacement - cependant, ces deux actions semblent contrôler uniquement les demandes de MacroDroid, et non la manière dont Android choisit de répondre.

Un bon moyen (peut-être le meilleur moyen?) D'obtenir des mises à jour de localisation plus rapides semble être de faire fonctionner Google Maps en même temps.
Merci pour toutes les infos.
 

Dm114

Well-known member
You will need to add a mechanism whereby your first macro waits for your another macro to be invoked. Try this (untested):

GPS macro...

T: GPS area trigger
A: store location test result to global variable (eg 1,2,3 etc)

BT macro...

T: BT connected
T: BT disconnected
T: MacroDroid variable change -- global variable != 0
A: if trigger fired = BT connected
A: set global variable = 0
A: enable GPS macro
A: force location update
A: else
A: disable GPS macro
A: end if
Why not to usea unique macro?
T: GPS area trigger
C: BT connected (either global at macro level or at trigger level)
 

Dm114

Well-known member
No it won't because of the constraint that prevents the macro to check location if BT is not connected.

But GPS by itself drains battery. It's the reason why mine is always off except when I really need it
 
Top