How do I use tasker with OpenVPN Connect for Android?

The following technical description helps configure Tasker for use with the OpenVPN Connect app for Android. It’s important to note here that the profile name mentioned below is defined during the import process, and doesn’t change even if you change the name of your profile after the import procedure has concluded. So if you want your profile to have a specific name, and you want to use that in Tasker, set that name correctly when you import the connection profile. If you change the name after, it displays with a different name in the app than what Tasker sees, as the original name the profile was given during the import process will be kept in the app.

1. CONNECT

Action: net.openvpn.openvpn.CONNECT
OR
Action: android.intent.action.VIEW
Cat: None
Mime Type: {blank}
Data: {blank}
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME:AS {your_profile_name} (if your profile was downloaded from URL)
OR
Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME:PC {your_profile_name} (if your profile was imported via File)
Extra: net.openvpn.openvpn.AUTOCONNECT:true
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity

2. DISCONNECT

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