The offical docs (https://docs.openvpn.net/connecting/connecting-to-access-server-with-android/faq-regarding-openvpn-connect-android/#How_do_I_use_tasker_with_OpenVPN_Connect_for_Android) state:
CONNECT
a) Access Server module
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
}
Extra: net.openvpn.openvpn.AUTOCONNECT:true
Extra: net.openvpn.openvpn.APP_SECTION:AS
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
b) OVPN Profile module
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:PC {
your_profile_name
}
Extra: net.openvpn.openvpn.AUTOCONNECT:true
Extra: net.openvpn.openvpn.APP_SECTION:PC
Package: net.openvpn.openvpn
Class: net.openvpn.unified.MainActivity
Target: Activity
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
Java code example
String profile = "myvpn";
Intent openVPN = new Intent("android.intent.action.VIEW");
openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity");
openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "PC "+profile);
openVPN.putExtra("net.openvpn.openvpn.AUTOCONNECT", true);
openVPN.putExtra("net.openvpn.openvpn.APP_SECTION", "PC");
activity.startActivity(openVPN);
The formatting is off but i hope it will help someone