Tasker Tutorial: Automate your home by connecting to WiFi

  • Use Cell Near and your router's MAC address in %HOMEMAC to accurately detect when you're at home.
  • Configure opposing "At Home / On the Go" profiles to turn on PC, manage WiFi, DNS and volumes.
  • Avoid temperamental network problems by triggering tasks based on nearby WiFi, cell towers, and weather conditions.
  • Extend home mode with Wake-on-LAN, more powerful WiFi selection, and sound and backup automations.

bike Bags

Tasker has been around for years the Swiss Army knife of the automation in AndroidIf you're reading this, you've probably already experimented with profiles, tasks, and contexts, but you want to go a step further: to have your mobile phone, simply by connect to home WiFi, be able to turn on your PC, adjust networks, save battery and behave "on its own" as you would manually.

Based on several real-world configurations and common questions (cell locations, nearby WiFi, problems with private DNS, car controls, etc.), we're going to set up a Full tutorial in Spanish so that you understand how y why Each piece works. The idea isn't just to copy profiles, but to know how to adjust them to your home, your router, and your PC without Tasker becoming an unmanageable mess.

General concept: what exactly do we want to automate

The classic goal of the "yanawa" wiki and many forum threads is always the same: that the mobile phone behaves differently when it is at home (or near home) than when you're out. From there you can hang up anything you want: turn on the PC, change the volume, manage WiFi and data, or even control home automation home, save battery and behave "only" as you would manually.

In practice, this behavior is usually constructed with a combination of:

  • Location by network cells (Cell Near / Nearby Antenna): to detect that you are "in the area" of home without using GPS.
  • Nearby WiFi / WiFi Connected: to fine-tune when you're actually connected to your router.
  • Global variables (e.g. %HOMEMAC): to identify your network without relying solely on the SSID.
  • Input and output tasks associated with a single profile “I am at home / I am on the street”.
  • Extra actions: Wake-on-LAN to turn on the PC, change private DNS, turn off WiFi when leaving, etc.

You'll see that several typical questions (whether or not you need a task just for %HOMEMAC, what the CDMA/GSM codes mean, what happens if you connect to a friend's WiFi, why some tasks are "attached" to the profile and others are not...) answer themselves when you understand this structure.

Variables and networks: how to identify your home WiFi without dying in the attempt

One of the first things recommended in Yanawa-type projects is to define a variable %HOMEMAC using your router's MAC address. The idea is simple: The MAC address doesn't change even if you change the SSID.It prevents conflicts with networks that have the same name and works for both Connected WiFi and Nearby WiFi.

You have two ways to assign that variable:

  • Specific task: You create a Task “Set Up Home” with an action VariableSet → Name: %HOMEMAC / To: AA:BB:CC:DD:EE:FFYou run it once and forget about it.
  • Assign it manually in Preferences > Variables (in some versions): cleaner, but many users are more comfortable with the explicit task.

It is not mandatory to have a task dedicated solely to that, but It is very practical to have an "Initialization" task. where you consolidate everything that only needs to be done once: filling %HOMEMAC, creating battery threshold variables, default volume values, etc. That way, if you change routers or move house, you know exactly what to run.

In the profiles WiFi Connected y WiFi Nearby You can leave the SSID blank and use only the MAC address via %HOMEMAC. The logic would be:

  • State: WiFi Connected → Profile “At Home (WiFi connected)”
  • State: WiFi Near → Profile “Near Home (WiFi nearby)”

This way, any change to the Wi-Fi name won't break your automation. And if your router broadcasts two SSIDs (2.4 GHz / 5 GHz), you can experiment with multiple MAC addresses or even lists of known networks, as you would in advanced tasks like "Connect to the strongest known Wi-Fi network."

Cell Near / Nearby Antenna: What does GSM:XXXX/0 mean and why is it important?

Best cheap mobile phones with a good camera

The other key piece of the puzzle is the profile of Nearby Antenna or “Cell Near”. When you enter the profile and tap on ScanTasker fills in a list like this:

GSM:1171.73790840 / 0
GSM:1371.73609849 / 0
CDMA:XXXXX/Y …

Those codes correspond to the cell phones that your phone sees at that moment. To put it simply: the cell towers that provide you with coverage. As long as you move around your house and surroundings, it's usually the same set or a very similar group.

To answer the common question: will that information always be the same when I'm at home? In practice, It is stable enough to use.Although sometimes the operator reconfigures cells, adds new antennas, etc. That's why the trick is:

  • Make several scans in different parts of the house and surroundings (living room, bedroom, entrance hall, garage) and keep the set of most repeated cells.
  • Don't obsess over a single perfect cell; what matters is that Tasker has several valid combinations to know that you are “close to home”.

This will help you create a profile like this:

  • State: Cell Near
  • And as an extra condition: Not Profile Active to avoid silly loops.
  • Entry task: “Activate WiFi when approaching home.”

This is exactly what the “Profile 3 – Near Home Test” in the example did: by detecting nearby antennas + that the “At Home” profile is not yet active, Turn on WiFi so that as soon as your mobile phone arrives, it connects to the router and triggers the next profile.

Automatically turning WiFi on and off (and why it sometimes doesn't turn off)

Automation scheme with Tasker and home WiFi

A very common pattern in Tasker is to have two opposing profiles like those seen in the example:

  • Profile 1 – At Home: Status: WiFi Connected (to your home SSIDs) → slightly increase the ringtone and notification volume.
  • Profile 2 – On the Street: Status: No WiFi Connected (those same SSIDs) → turn up the volume, turn off WiFi.
  • Profile 3 – Close to Home: Cell Near + No Profile “At Home” → turn on WiFi to prepare the ground.

The typical case that drives you crazy: The profiles seem to work, but the WiFi never turns off.even if you go 50 km from home. There are several common reasons:

  • In recent Android systems, the system can Re-enable WiFi in the background (by location, scans, etc.). Tasker tells it to shut down, but Android turns it back on.
  • The "No WiFi Connected" profile only spikes compared to those specific networksIf the mobile phone connects to another WiFi network (work, bar, a friend's house) that is not on the list, the profile will not be triggered.
  • In some brands you need Tasker Settings or special permissions (writing to secure settings, ADB, root…) to reliably control radios such as WiFi, data or GPS.

Best practices to ensure the shutdown actually works:

  • In the "On the Street" profile he uses No WiFi Connected with your home SSIDs, but also add a timeout or time condition, for example: only if you wear 5 minutes without being connected to homeTurn off WiFi.
  • Check in your phone's settings that nothing like “WiFi scanning always available"to improve location; that can keep the radio alive."
  • If your phone has aggressive battery optimizations, Tasker excludes And if you use Tasker Settings, exclude it as well.

If, despite everything, the WiFi continues to turn on by itself, you'll have to take a more aggressive approach: use a Secure Settings plugin or even an Xposed-type module (on rooted devices) to force the state, but that's already advanced territory.

What if I want to connect to a friend's WiFi or my work WiFi?

Another common question: “If I go to a friend’s house and want to connect to their WiFi, can I turn it on manually? Will that break the project?” The short answer: Yes, you can, and nothing will break if you've assembled it correctly..

The logic of the “At Home” / “On the Street” profiles is tied to your SSID or %HOMEMAC. Namely:

  • When you're at home, the Home profile is activated because the WiFi is connected to that red.
  • When you lose that specific network, the "On the Street" profile does its job.
  • If you connect to a different network, Tasker doesn't see that connection as "home," so it doesn't launch either the login or logout of those profiles.

What does this mean? It means that if you manually turn on the WiFi at your friend's house and connect, Tasker will not activate the "At Home" profile (because neither the MAC address nor the SSID matches), so it shouldn't cause any problems with volumes, DNS, or anything else. The only thing to watch out for is that:

  • If you have general "WiFi Connected" profiles without filtering by network, they will trigger there as well.
  • If you don't want Tasker to touch anything outside your home, make sure that All your WiFi profiles use SSID/MAC, filtering only your home network.

Profiles with "attached" tasks vs. separate tasks: Was I using Tasker wrong?

bike Bags

In projects downloaded from wikis or forums, it is very common to see tasks defined within the profile itselfwithout going through the TASKS tab with its fancy names. Many people then think they were "doing it wrong" by creating separate, reusable tasks.

The reality is that Tasker lets you both strategies:

  • Embedded tasks On the profile: visually cleaner, everything "in one place". Perfect for simple automations that you won't reuse.
  • Independent tasks in the Tasks tab: ideal when you use the same sequence of actions in several different profiles (e.g., “Night mode”, “Car mode”, “Sync only via WiFi and plugged in”).

You weren't using Tasker incorrectly; it's just that You had a more modular structureIf you find it overwhelming to see too many separate tasks, you can group them by projects or prefixes in the name, but in the long run it's very useful to have things like "Turn on/off private DNS" or "Adjust home volumes" in their own Task so you can call them from multiple locations.

Private DNS and WiFi that “has no internet”: how to launch profiles even when the network fails

A real-life case that causes quite a bit of trouble is that of the user who uses a Private DNS (NextDNS, AdGuard, etc.) Set up on Android. At home, perfect. But on the work WiFi, the network Blocks custom DNS queriesAndroid detects that there is "no internet" on that WiFi and decides to continue using mobile data.

This user tried to fix it with two profiles:

  1. WiFi Connected → Secure Settings: type global private_dns_mode = opportunistic (without hostname, so that it works with the corporate network).
  2. No WiFi Connected → Secure Settings: type global private_dns_mode = hostname (Return to NextDNS when leaving WiFi).

His home WiFi worked perfectly, but At work, the "WiFi connected" profile never triggered.because the connection was not established as such in the eyes of Android due to the captive portal/connectivity validation failing.

Is there a way to activate the profile even if the system thinks there is "no internet access"? Options:

  • Use Status: WiFi Near Instead of "WiFi Connected," it triggers the task as soon as the phone detects the network, even if the connection hasn't been validated yet. The problem: on recent Android devices, due to battery limitations, Tasker warns that it can only scan... every 15-30 minutesso it may be delayed.
  • Use a Event: WiFi Scan Results (Intent android.net.wifi.SCAN_RESULTS) If your system allows it; some devices launch that Intent even without valid connectivity.
  • As a last resort, trigger the task by Cell Near + work hours (for example, antennas that you only see in the office, range 8:00-19:00) instead of by WiFi.

In any case, the key is that Don't rely solely on the "WiFi with Internet OK" status.If the work network is really bad, you'll have to get creative with cell towers, nearby SSIDs, or even GPS geofencing if you have no other option.

Turn on your PC automatically when you connect to your home WiFi (Wake-on-LAN)

What does the Baby Wifi icon mean on Android? Full explanation

Let's get to the main course of the title: turn on the computer without touching the power button as soon as the phone connects to the home Wi-Fi. This is done with Wake-on-LAN (WOL) and Tasker supports it indirectly through plugins or network actions.

PC prerequisites:

  • Network card compatible with WOL (almost all current ones are).
  • Enable something in the BIOS/UEFI like “Wake on PCI-E / LAN”.
  • In the operating system (Windows/Linux), enable the network adapter “Reactivate the team”.
  • Shut down the PC in a mode that supports WOL (soft shutdown, not deep hibernation on some motherboards).

In Tasker, the typical workflow would be:

  • Profile: Status → WiFi Connected
  • Entry task: “Turn on Home PC” with one of these options:
    • Use a plugin Wake on LAN (There are several on Google Play compatible with Tasker) where you configure the PC's MAC address and your network's IP/broadcast address.
    • Use Send Intent o HTTP Get If you have an intermediate device (router, Raspberry, NAS) that exposes a URL that triggers WOL.
    • In older versions and with root access, you could launch a network command directly from Tasker, but nowadays a plugin is more convenient.

It is important that the WOL package shipment is as soon as possible After connecting to Wi-Fi, because many routers only correctly propagate the "magic packet" in the first few seconds after connecting, depending on ARP and internal tables. If you notice that it doesn't wake up on the first try, try:

  • Send the WOL two or three times with a Wait 1-2 seconds in between.
  • Use your local network's broadcast address (e.g. 192.168.1.255) instead of the PC's static IP address.

Once you've verified that your PC boots up like a champ, you can chain "home mode" actions to that same task: open a remote desktop app, increase screen brightness, disable data saving mode, etc.

Always connect to the strongest known WiFi network: when you have many networks nearby

In environments with several known networks (home, office, neighbor's router that you've been given, access points spread throughout a large house), Android's default behavior can be quite silly: it stays on a network with a weak signal even if there's another one of yours with three more bars.

The Tasker community has developed very powerful tasks for automatically choose the strongest known WiFi networkAn advanced example uses:

  • El wifi manager from Android via Java Function to obtain the list of configured networks and the networks seen in the last scan.
  • Regular expressions to extract SSID y signal level (RSSI) of each entry.
  • A list of SSID on blacklist (%blacklisted_ssids) to avoid connecting to certain networks even if they have a good signal.
  • A variable %switch_if which indicates "change networks only if the current one is below that quality".

The general flow of that task (very briefly summarized) is:

Prevent WiFi from disconnecting when you lock the screen

  1. Check that WiFi is turned on (%WIFI eq on) and the screen is active (to avoid any mishaps when the phone is asleep in your pocket).
  2. Collect the SSID and current network strength.
  3. If the force is above %switch_if, do nothing (avoid constant changes).
  4. If it's below, throw a startScan() From WifiManager, wait a few seconds and get getScanResults().
  5. Cross-reference scan results with the list of already configured networks (those with saved passwords).
  6. Exclude SSIDs that are in %blacklisted_ssids.
  7. Calculate the relative strength of each network with WifiManager.calculateSignalLevel() about the crude RSSI.
  8. Keep the SSID of greater strength and, if it's not the current one, do Connect to WiFi .

It's a delicate task, with many steps, but it allows things that Android alone cannot do: Bypass weak networks, ignore problematic SSIDs, adapt to Android 12/13 by changing the regex according to the SDK… If you have a house full of repeaters or an apartment with many overlapping networks, it's worth investing time in a solution like this.

Other typical tricks that fit very well with "home mode"

Once you have the "I'm at home" context well defined (cells + WiFi / %HOMEMAC), you can hook up all the Tasker artillery that appears in wikis and compilations or Android smart home panels:

  • SMS and location-based alerts: send an automatic message to your partner when you approach their house, read SMS aloud when you are driving, announce the weather aloud in the morning as soon as you unlock your mobile phone.
  • sound profiles: silence your mobile phone during meetings according to the schedule, turn the volume up to maximum for important contacts, change the ringtone every time you receive a call.
  • Advanced battery saving: Sync only at night with WiFi and plugged in, switch between data and WiFi depending on network quality, recreate Juicedefender's behavior with pure Tasker.
  • Reading mode and tablets: Turn off WiFi and data when you open your reading app and restore when you exit, automatically turn off the tablet if it has been without a screen and unplugged for 30 minutes.
  • Backups and cloudUse DropSpace or Dropbox plugins to sync SD card folders with the cloud only when you are at home and connected to WiFi.

The great thing about having a very reliable "home mode" is that all these tasks They stop firing everywhere and they fit into a logical context: only when you are on your network, with your PC nearby and with plenty of power.

In short, by relying on Cell Near + WiFi Connected to your home MAC, well-thought-out global variables, and some advanced tasks like choosing the most powerful WiFiYou can get your Android device to know when it's home better than you do. From there, turning on your PC via Wake-on-LAN, configuring private DNS settings based on your network, adjusting volume and sound profiles, or triggering nightly backups goes from being a geeky experiment to an invisible routine that happens every day without you even having to think about it.

Automate your home with Home Assistant
Related article:
How to automate your home with Home Assistant step by step

Add as preferred source in Google