I switched to “OpenVPN for Android” which can use the “OpenVpn Tasker Plugin”. I use it to connect and disconnect on certain conditions but I think it can report when it is active or not.
I’ve used the shell command ifconfig and regex for tun0 or tun1 to detect if on VPN, but this is a command that has to be explicitly run, it won’t monitor, if that’s what you’re looking for.
I’m very new to Tasker and as such am undoubtedly missing something obvious, but I’ve clicked through every item in tasker I can find and have looked through the list of status items available for ‘Variable Select’ and I don’t see “VPN Connected” anywhere (the list appears to be in alphanumeric order and jumps straight from “Volume - System” to “WiFi Info”). If you can elaborate a bit on where to find that state, it would be super-helpful.
For State I set (in the Net subcategory) VPN Connected - Any. My entry task is a simple task with Variable Set %VPNC to 1 and my exit task is a simple task with Variable Set %VPNC to 0.