You can do this with gps or cell location, but it can also be done with wifi detection. Basically the phone turns on the wifi every few minutes and checks for the network. I tried this for home, but elected to use a widget instead so my wifi didn't drain my battery.
Use the "wifi near" state, then wifi on. I would combine it with something to turn off wifi at night if you're using it for your home network.