any chance i could have a look at your tasker job. I tried it but couldn't get it working right so might be something i'm doing wrong.
Sorry, I didn't notice this request until just now.....
The task itself is pretty simple. When the task is started, it checks to see what wifi I am connected inside an IF statement. If I am NOT connected to the home wifi, then it auto connects to the VPN service. You use the Tasker "Send Intent" command found under "System" for this and I used this walk-though (
OpenVPN 3.0.X - Connect and Disconnect with Tasker) for the exact settings inside of this "Send Intent" command. Then I wait 4 seconds before ending the IF statement. Then I start the
BlueIris app. So my task looks like this:
1. Net Test - type Wifi SSID, store result in %WifiSSD
2. IF %WifiSSD neq MyHomeSSID
----- 3. Send Intent (to connect VPN)
----- 4. Wait 4 seconds
5. End IF
6. Launch App - Blue Iris
This way, the task always starts BI, but will first autostart the VPN connection if I am not connected to the home wifi. The 4 second delay is to get the connection to finish before BI app opens and tries to login - you can tweak this time if needed. I have a shortcut that starts this task on my phone's "desktop" which is what I normally use to access BI. I also use the icon for the BI app as the image for this shortcut, so it seems like you are simply opening the BI app, but in reality it is a shortcut to this tasker task.
I also have a "disconnect VPN" task set up that fires anytime I exit BI. It also checks to see if I am NOT connected to the home wifi and if not, then I close the VPN connection using the same walk-through directions. If I am connected to home wifi, it doesn't do anything. I
think I set it up this way because if you try to disconnect from the VPN when you aren't actually connected it must throw an error, but honestly I don't remember. This works even when simply changing over to another app (ie I don't have to "close" or "exit" the BI app). My close task looks like this:
1. Net Test - type Wifi SSID, store result in %WifiSSD
2. IF %WifiSSD neq MyHomeSSID
----- 3. Send Intent (to close VPN)
4. End If
The "exit" task can be slightly annoying if I am trying to troubleshoot something away from home and therefore I'm opening and closing the BI app fairly often. This doesn't happen very often and I usually just live with it having to reconnect to the VPN when restarting the app, but I can always disable the exit task if it is extra annoying that day. However under normal use you won't even notice it and I find it really nice not to have to manually turn off the VPN when I'm done using BI.
Anyway, I hope that helps. I can always post screen shots if that would help, but really the details found in that walk-through are probably what you are missing, and the walk-through goes into a lot more details than my screenshot would.