Is there a way to automatically turn off the wireless hotspot once I get back home? I use the wireless hotspot function daily as part of business, providing a wifi network from my Nexus 7 tablet (Lollipop, oem) to other business-essential devices.

When I get back home (alternatively, within range of my home Wifi network), I'd like to have the hotspot automatically turn off, and the tablet to use the wifi network.

Currently, if I forget to turn off the hotspot, I can inadvertently empty or overuse my mobile data, which is obviously quite costly.

So, is there a way to have the hotspot turn off automatically (but not using a timeout) based on location and/or wifi availability?

I would prefer non-root, non-flash-another-ROM solutions but am open to these as well if they're more elegant.

//edit: An additional problem is that work and home are ~300m apart in a rural environment, so geolocation is flakey and the cell tower doesn't change. Wifi presence is the only good discriminant I see...
Other than MacroDroid which is already covered by 3DDario here, you can consider any of the following apps -- none requires root for the goal.

Tasker (paid; 7 day free trial).


Profile: Any of the following would do:


Location: choose the location
State &rarr; Net &rarr; WiFi Near &rarr; fill the details -- I'm unsure whether it would work if the hotspot is enabled.

Task &rarr; (Action) &rarr; Net &rarr; WiFi Tether &rarr; Off

Since the final goal is to connect to Wi-Fi at home, another action can be Net &rarr; WiFi &rarr; Set &rarr; On.




Droid Automation (free/paid) may also work here.


Trigger: Location area (Geofencing - Beta) &rarr;  fill the details
Task: Networks &rarr; Wi-Fi &rarr; Enable


The dry run worked for me. 



Condi (free) also worked in my test case.


Action: 


Connectivity and Sensors &rarr; WiFi Tethering &rarr;  Off
Connectivity and Sensors &rarr; WiFi  &rarr;  On

Condition: Location &rarr; select location


Done!