Basically I have a Jellyfish (Plex equivalent) that I need a VPN to access. I use it to listen to music so I want to have the VPN to remain on even if I switch apps/go back to the home screen. This makes the app opened/closed automation irrelevant.
If your concern is forgetting to turn off VPN after some time, you could use an app like Actions, which comes with a shortcut action “Is VPN on?,” together with a few scheduled automations that check if you’re connected, and if “yes,” go ahead and disconnect.
I have a quick settings shortcut from where I can toggle the VPN quickly, but I always forget to disable it… That’s why I wanted to automate, but not possible apparently. Thanks !
That could be a solution, but if I’m using the app during the automation it might cut the audio off. And running it at night is not much use as I turn off my phone at night. I use Toolbox Pro already and wanted to use the « is media playing » action to counter this, but it is a premium tool.
It seems to be working for me right now with Tailscale. It’s not always instantaneous but honestly still way more convenient than activating it manually.
Actually I’ve just thought about this again:
The app actions does have an action called „is audio playing“.
You could check against that (on app closure through automations) and if it returns true, you won’t do anything, but if it returns false, you cut the vpn.
Haven’t tested this yet, but in theory this could work.
Yes, it happens to me also to forget to disconnect the VPN, but if you have set split tunnel you shouldn’t be worried about consuming mobile data. Maybe just the battery life would be affected.
This works very well! My 13 mini sometimes skips the automation but I just have to wait a bit. For some reason I thought Actions would be paid too! Thanks
I have since decided to keep the VPN on at all times. However, when I had it set up, it was a very simple shortcut. You need to install the Actions app, and then create 2 automations.
If Media Playing is yes, do nothing. If no, connect to VPN (run when opening your app).
If Media Playing is yes, do nothing. If no, disconnect from VPN (run when closing the app).
Make sure you have VPN on demand enabled in both the app settings and VPN configurations in Settings. It might not work as intended otherwise.