VPN Wireguard automation (with variables)

by Mathieu Lantin

Version 1 (June 29, 2026)

Download (117 downloads)

Fork of Yassine Nacif (Nassh) VPN automation, kudos for the original one!

This fork adds variables for the trusted wifi networks and the tunnel you want to automate. That makes it very easy to configure if you want to automate several Wi-Fi networks.

***PLZ READ!!!***
Full reliable VPN automation for wireguard.

It simply toggles on and off according to your network.

If you are connected to your home network (or a network of your choice), it will toggle off, and once such network is left it will toggle on Wireguard until you reconnect back to that network.

It is designed to properly set the VPN on or off upon starting the flow. Making it reliable in case the phone restarts, or sudden network changes.

It is also designed with high connectivity in mind. Meaning, that once your tunnel is enabled, the flow will run a ping test to Google (a simple connection test to the Internet) to check if you have internet access. If the test fails, it proceeds to disable the tunnel.

To set up:
1. Go to your Wireguard app, in settings, enable "Allow remote control apps"
2. Go to your Android Settings/Applications/Wireguard/Battery and disable battery optimisation.
3. Go to your Automate Settings > Privileges and enable "Edit wireguard tunnels"
4. Edit the following blocks in this flow:
4.1 Block with ID 85, which is a variable block. Put in the Input arguments the names of the wifi for which you want your VPN to be disabled.
Change wifi_name_x with the name of your wifi network. If you want to automate several networks, respect the quotes, comma and bracket:
["wifi_name_1", "wifi_name_2"]
4.2 Block with ID 90, which is a variable block. Put in the Input arguments name of the tunnel you want to automate.
Change "your_tunnel_name" with the name of your actual tunnel. You should find it on your Wireguard app.

Comment, rate, or even remake.

Thanks and I hope it is helpful.

5.0 average rating from 1 reviews

5 stars
1
4 stars
0
3 stars
0
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.