Skip to content

Privacy friendly way to turn on Wireguard depend on home/away scenario #1294

Open

Description

@iulko

I was looking for a privacy friendly way to check if we are home or away from home so that we know if wireguard (and other things) should be on or off. Tasker integration is a big project but this simplify it to some extent and is what most people need.

The only information we propably get about network you connect is IP you get assigned, mask, gateway and DNS.
Because ssid/wifi name checking needs location service its a no no for most people.

Could we have a way to for example to treat a Wireguard tunel as "turned off" when DNS IP is specific IP, or IP you got assigned is a specific IP? This would not turn off Wireguard tunel like if you do it yourself, it would just make the tunel act as "turned off" if your system DNS IP is a specific IP.

Wireguard tunel "Test" is turned on -> Is ON in every network -> when a network have system DNS IP 192.168.5.12 than wireguard gets disabled but not turned off, its just skipped.

Any questions or doubts please let me know

Activity

  1. ignoramous commented on Mar 18, 2024

    @ignoramous
    Collaborator
  2. ignoramous commented on Sep 18, 2024

    @ignoramous
    Collaborator

    A user writes,

    The official Wireguard app uses these intents which creates a custom permission. Then in this file, the intents are handled. Where needed, the tunnel name is specified as a parameter. I couldn't find anywhere that allows Tasker to detect the function named WireGuardSetTunnel that it uses to control WG, but as far as I can tell, that function is simply a wrapper for an intent broadcast. Tasker can directly perform such broadcasts as well.

  3. ignoramous commented on Sep 11, 2026

    @ignoramous
    Collaborator

    ... looks at a canary file on the local network before activating the WireGuard connection, and compares its content to a predefined value.

    ...

    This would mean adding 2 settings: a local URL to check for, and a value to compare to the data returned by the URL .
    I.e:
    local URL: "http://192.168.0.1/canary"
    expected value: "Lucy, I'm home !"

    By @pmaziere in #2537.

  4. ignoramous commented on Oct 15, 2026

    @ignoramous
    Collaborator

    WireGuard automation with Intents has shipped in v058.

    From the instructions in Configure -> Settings -> Automation:

    Instructions:
    Required extras in the broadcast:

    • Key: sender
    • Value: The package name of the calling app

    Example: key:sender value:com.termux

    Supported actions:

    • Start Rethink – com.celzero.bravedns.intent.action.VPN_START
    • Stop Rethink – com.celzero.bravedns.intent.action.VPN_STOP

    WireGuard actions (require the WireGuard automation toggle above;
    extra key: wg_ids – comma separated WireGuard config ids, e.g. 1,2,3):

    • Start WireGuard – com.celzero.bravedns.intent.action.WG_START
    • Stop WireGuard – com.celzero.bravedns.intent.action.WG_STOP
    • Pause WireGuard – com.celzero.bravedns.intent.action.WG_PAUSE
    • Resume WireGuard – com.celzero.bravedns.intent.action.WG_RESUME
  5. pcause commented on Oct 15, 2026

    @pcause

    i am new to tasker. I imported the basic start wireguard but where in the asker interface do I put the wg_ids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions