A Sonoff (eWeLink) device turns on/off depending on entering/exiting a specified zone. Location is detected by your phone (and its location services running for IFTTT) and specifying 'Single Unit' Sonoff Switch/Plug
Explore more great ways to automate eWeLink Smart Home and Location