I wonder if you'd be able to set up a rule in something like Tasker (Play store link, sorry) to activate the tunnel when you're off your home network. I haven't used Tasker in years though, sorry.
Proton
Empowering you to choose a better internet where privacy is the default. Protect yourself online with Proton Mail, Proton VPN, Proton Calendar, Proton Drive. Proton Pass and SimpleLogin.
Proton Mail is the world's largest secure email provider. Swiss, end-to-end encrypted, private, and free.
Proton VPN is the world’s only open-source, publicly audited, unlimited and free VPN. Swiss-based, no-ads, and no-logs.
Proton Calendar is the world's first end-to-end encrypted calendar that allows you to keep your life private.
Proton Drive is a free end-to-end encrypted cloud storage that allows you to securely backup and share your files. It's open source, publicly audited, and Swiss-based.
Proton Pass Proton Pass is a free and open-source password manager which brings a higher level of security with rigorous end-to-end encryption of all data (including usernames, URLs, notes, and more) and email alias support.
SimpleLogin lets you send and receive emails anonymously via easily-generated unique email aliases.
Tasker
What you want is Easer: https://me.ryey.icu/Easer/en/
Like Tasker, but FOSS and available via F-Droid
Is there newer version/alternative to this?
Hey, I have done something similar to this.
I turn the VPN on every time I connect to a WiFi without the SSID of my trusted places.
Super easy with tasker.
Here is the XML to import and experiment with OP:
<TaskerData sr="" dvi="1" tv="6.4.15">
<Profile sr="prof7" ve="2">
<cdate>1693206728189</cdate>
<edate>1742652330550</edate>
<flags>8</flags>
<id>7</id>
<mid0>8</mid0>
<mid1>9</mid1>
<nme>VPN Automation</nme>
<State sr="con0" ve="2">
<code>160</code>
<pin>true</pin>
<Str sr="arg0" ve="3">HomeWifi/telenet-C6DE3/My VW 4685</Str>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="2"/>
</State>
<State sr="con1" ve="2">
<code>110</code>
<pin>true</pin>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
<Int sr="arg4" val="1"/>
<Int sr="arg5" val="0"/>
</State>
<State sr="con2" ve="2">
<code>160</code>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Int sr="arg3" val="2"/>
</State>
</Profile>
<Task sr="task8">
<cdate>1693214693841</cdate>
<edate>1694095080534</edate>
<id>8</id>
<nme>Turn On VPN</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>365</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""/></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(true,BE-wg)</Str>
</Action>
</Task>
<Task sr="task9">
<cdate>1693214759029</cdate>
<edate>1693374826981</edate>
<id>9</id>
<nme>Turn Off VPN</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>365</code>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""/></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">WireGuardSetTunnel(false,BE-wg)</Str>
</Action>
</Task>
</TaskerData>
Thanks for that! I did consider seeing if tasker could do that as I used it a lot when I used to run android as my daily driver (was on iOS for a long time and finally flipping back).
Appreciate the example!
I use Express VPN and the app has the ability to connect to VPN automatically when not on trusted networks. You can white-list any Wi-Fi you trust and anything not on the white-list gets automatic VPN connection. I assume most VPN providers offer similar options.
Edit: You can also white-list or black-list the Mobile Network.
I just excepted my phone from the network VPN and leave the phone VPN on all the time.
Automation is an Android app to automate certain things on your device. https://f-droid.org/packages/com.jens.automation2/ https://server47.de/automation/
?
Thanks. It doesn't look like it can control VPN connections though.
I do the opposite. I turn on my VPN at home. I share Netflix with my bro in law and don't want to get caught being in different places. On my Samsung Fold 5, I can run a routine to connect to VPN when I get home.