How do I use Tasker with OpenVPN Connect for Android?

Use the steps here to configure Tasker for use with the OpenVPN Connect app for Android 3.3.2 and newer.

Note: The Profile_ID mentioned in the Connect Action below is defined during the import process — it doesn't change even if you change the name of your profile after the import procedure has concluded.

Tasker can launch VPN connections autonomously when a profile doesn't require additional authorization steps or the user has previously saved connectivity credentials for the profile in Connect. Otherwise, the user is prompted to authenticate manually.

Tasker can control the following Actions:

  • Connect VPN (with specified profile).
  • Disconnect VPN.

Follow the steps below to set up Tasker for each Action above.

Connect VPN

Step 1:

  1. Open OpenVPN Connect.
  2. Tap the Edit icon for the preferred profile.
  3. Find the Profile ID at the bottom of the screen and tap the copy to clipboard icon.

Step 2:

  1. Open Tasker.
  2. Create an Action with the following parameters:
    Action: net.openvpn.openvpn.CONNECT
    Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_ID:'{your_profile_id}'
    Extra: net.openvpn.openvpn.AUTOCONNECT:true
    Package: net.openvpn.openvpn
    Class: net.openvpn.unified.MainActivity
    Target: Activity

Disconnect VPN

Step 1:

  1. Open Tasker.
  2. Create an Action with the following parameters:
    Action: net.openvpn.openvpn.DISCONNECT
    Cat: None
    Mime Type: {blank}
    Data: {blank}
    Extra: net.openvpn.openvpn.STOP:true
    Extra: {blank}
    Extra: {blank}
    Package: net.openvpn.openvpn
    Class: net.openvpn.unified.MainActivity
    Target: Activity