Not a blueprint but though I’d share my automations on how you can control your tailscale VPN connection on your phone.
There is a current limitation that the Tailscale app has to be open in the background for the VPN to turn on. Fixed by @fantangelo.
Current limitations:
- There is a bug that once that connection is up it sometimes can only be diabled by the automation/device restart, not manually stopping the connection: If android intent is triggered more than once, a connecting loop is triggered and you can't disconnect · Issue #8013 · tailscale/tailscale · GitHub
- It seems to inly run when the device first ‘wakes’
- When it runs it opens the tailscale app
alias: "[phone] Tailscale when away from home wifi"
description: >-
This automation enables tailscale when away from home wifi and disables it
when at home.
trigger:
- platform: state
entity_id:
- device_tracker.pixel_3a
to: not_home
id: away
- platform: state
entity_id:
- device_tracker.pixel_3a
from: not_home
to: home
id: home
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: away
sequence:
- service: notify.mobile_app_pixel_3a
data:
message: command_launch_app
data:
package_name: com.tailscale.ipn
alias: Ensure App running
- service: notify.mobile_app_pixel_3a
data:
message: command_broadcast_intent
data:
intent_package_name: com.tailscale.ipn
intent_action: com.tailscale.ipn.CONNECT_VPN
alias: Enable VPN
- conditions:
- condition: trigger
id: home
sequence:
- service: notify.mobile_app_pixel_3a
data:
message: command_broadcast_intent
data:
intent_package_name: com.tailscale.ipn
intent_action: com.tailscale.ipn.DISCONNECT_VPN
alias: Disconnect tailscale
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: notify.mobile_app_pixel_3a
data:
message: command_broadcast_intent
data:
intent_package_name: com.tailscale.ipn
intent_action: com.tailscale.ipn.DISCONNECT_VPN
alias: Ensure tailscale disconnected
mode: single