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.
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.