Profile to disable VPN when connecting to Android Auto only works about half the time due to momentary bluetooth disconnect

I use an adblocker on my phone(Adguard) that works by running a VPN on the phone. Unfortunately, I also use Android Auto in my car, and Android Auto wireless can’t work with a VPN, so I setup a simple tasker profile to disable the VPN when I’m in my car, using a bluetooth state.

When bluetooth connects, it disables Adguard(send intent stop), the reenables it when bluetooth disconnects(send intent start).

Android Auto wireless starts by detecting your phone via Bluetooth when the head unit starts, then once you press the android auto button, it will then connect your phone to the wifi on the head unit. What seems to happen though, is that the bluetooth will disconnect very briefly(maybe a few seconds at most) while the wifi connects, before reconnecting. About half the time it does this, tasker will restart the VPN and I won’t be able to connect unless I manually open tasker to execute the disable task, which is quite annoying when I’m in my car.

I think what would work is if the enable VPN task had some sort of dwell that would wait for some amount of seconds, check for bluetooth again, then execute the enable if bluetooth was still disconnected(otherwise it would do nothing). This would be pretty easy to do via programming but I’m not sure how to do it with tasker’s relatively simple flow of enter state → do thing, exit state → do another thing.

Any help is much appreciated!

Adguard has a split tunnel option that lets you whitelist apps to not be on the VPN, you can select Android Auto and then you don’t have to disable Adguard at all.

Create a time profile that runs from to a global variable. Run your current BT exit task from this new profile and add turning off the time profile along with your BT check (alternatively, you could turn off the time profile in your BT enter task and not have to do a BT check). Then replace your exit task for the BT profile with a new task that sets that global variable equal to %TIMES+5 (for 5 seconds), and enables the new time profile. The created time profile then runs your current exit task after a, in this case, 5 second delay.

Damn. Thanks for the heads up, much easier option.

Thank you! Got it set up I think, I’ll see how it goes next time I’m in the car. Much appreciated.

How do you whitelist it? I selected to not route android auto through adguard but having the same issue. Any help would be greatly appreciated!

Hey, it’s obviously been a while since I did this but I just looked at the app and I think I just disabled AdGuard protection for the Android Auto app

Apps Management > Android Auto > uncheck “AdGuard protection” under settings

Hope this helps or you’re otherwise able to fix it.

Thank you sir… I appreciate it. I did that but still having issues. Thought maybe I missed something.

Same here tried both… disabling for Android Auto and only port the apps needed