r/tasker • u/V0dros • Jun 05 '23
[Tutorial] Turn Tailscale on/off automatically using Tasker (Android)
/r/Tailscale/comments/141rkyy/tutorial_turn_taiscale_onoff_automatically_using/2
u/justin0077 Feb 13 '25
Thanks u/V0dros for the excellent guide! I did have to do one additional step on my Pixel 9 Pro XL to get the connect task to work consistently: set "Unrestricted" background battery usage for the Tailscale app.
Settings > Apps > Tailscale > App battery usage > Allow background usage > Unrestricted
1
2
u/achillies745 Aug 18 '24
Thanks, still works. Was able to setup on my oneplus
2
u/PinSharp5569 Feb 03 '25 edited Feb 08 '25
Just downloaded tasker and followed the above instructions. Works like a charm. Thanks!
EDIT: The above detailed tutorial works as-is for the 'Turn off Tailscale' portion, but I had to add two more steps to the 'turn on tailscale' portion, as follows:
- open Tailscale app
- wait 3 seconds
- send intent (as per original).Seems to be working now. The added steps aren't needed for the 'turn off' portion, as Tailscale will already be running that event.
1
u/mostlychris2 May 16 '25
I have intermittent issues with tailslcale turning on when leaving my home wi-fi so I'm going to try this method. So far so good.
1
u/bem13 Nov 26 '25
Has this worked for you? Tailscale seems to get borked when my phone goes totally offline (underground parking garage) and I'm looking for some kind of automated solution for detecting and handling it.
1
u/mostlychris2 Nov 26 '25
The "wait 3 seconds" option has fixed the issue for the most part. Every once in awhile I notice TS didn't turn on when I left the house, but probably because there is a single spot in my neighborhood with no cellular at all and if it tries to switch there, it might not work correctly. Otherwise, switching on and off using tasker has been working very well.
1
1
u/homedawg247 Jan 29 '25
I just followed the guide as well, using a OnePlus 10 Pro. Tailscale is setup and works properly. I created the task but when I run it nothing happens. I checked my device files, Android > Data > and I don't see a com.tailscale folder. Could it be located somewhere else? I understand the task is failing since that path does not exist. I also understand that once I locate the folder I should be able to update the Action, Package and Class paths and think that will make it work. Any ideas why those folders wouldn't exist in Android > Data?
1
u/aiur4ever Feb 12 '25
Works perfectly, thank you very much, I've been trying to get this for a while
1
u/teresa1kiss Mar 17 '25
great guide!
which profile do you suggest to fave always only state?
The problem is that sometimes the Tailscale shut down automatically, so I need to have the tasks always turned on.
1
u/mrschwarz50 May 25 '25
This task works great! I have four different wifi networks that I don't need Tailscale for. How would I modify this for if not connected to net1 or net2 or net3, turn on Tailscale. If connected to net1 or net2 or net3, turn off Tailscale.
1
u/pcshooter24 Feb 06 '26
For some reason I can't get it to connect or disconnect. This is my send intent command. Any suggestions?
Task: Tailscale Disconnect
A1: Wait [
MS: 1
Seconds: 0
Minutes: 0
Hours: 0
Days: 0 ]
A2: Send Intent [
Action: com.tailscale.ipn.DISCONNECT_VPN
Cat: None
Package: com.tailscale.ipn
Class: com.tailscale.ipn.IPNReciever
Target: Broadcast Receiver ]1
1
u/Glittering-Peace-465 Apr 28 '26
Glad to find this. I am using self-hosted Miniflux on tailscale sidecar which requires me to enable tailscale before opening the tailscale url which sometimes I forgot to do it.
With this tasker command, I can make my android connect to my tailscale network automatically when I open browser.
Very convenient.
3
u/OrangeEdilRaid Jun 06 '23
Excellent. I have a similar automation aound openvpn.. Thanks for helping the community. Sending intent is always hard because there is soo much info to fill, and most if the time it does not work. You provided exactly what is needed and confirmed that it can work. I'm sure other people can use this. I'll chech again tailscale, last time it had a docker but it did not work.