These already exist. 
Use the quick browse lists in the community-created wiki and look at presence DTHs. There’s one there with switch capability.
http://thingsthataresmart.wiki/index.php?title=How_to_Quick_Browse_the_Community-Created_SmartApps_Forum_Section
There are also a couple of older ones in the forums if you want some additional variants.
Also, if you have an android device you can do this with sharptools and Tasker.
If you’re feeling really ambitious, you can also set up your own presence sensor using your own Wi-Fi, but it requires some technical skill.
All of these options are discussed in the presence FAQ: