Disable GPS if app and BT are disconnected for 2 minutes

Retool9353

New member
Hi everyone,
I need the GPS enabled in two cases: if I have some app opened or if my phone is connected to the app.
The enabling macro works fine, it enable it every time I need it.

My issue is disabling it. I need the Macro to check that the app is closed and that the phone has been disconnected from my car for at least 2 minutes.
My macro (the attachement) is not working. This is what it does in words:
IF app closed OR bt disconnected
THEN wait 2 minutes
IF app closed AND bt disconnected
THEN disable GPS

The issue is that it never works, and I think that there is probably some better way to do that. Maybe some macro that can edit a global variable? I never used variables in macrodroid so I'm not sure if it's possible.
 

Attachments

  • photo_2023-03-06_18-47-37.jpg
    photo_2023-03-06_18-47-37.jpg
    96.1 KB · Views: 12

dhj49er

Well-known member
The macro won't do what you expected because you have used the same trigger in both if statements. Also the use of 2 if actions is also incorrect for this macro

I suggest you replace the 2nd if statement with

Else If trigger fired Device Disconnected

Try that and see if that works.
 
Top