Do you still remember Cuttlefish? With this neat application your computer becomes aware of its surroundings and can react to a switch of the wifi network, a plugged in USB devices, aso. These would be the triggers.

What makes Cuttlefish so very useful are the reactions you can combine this with. E.g. I'm turning the phone in my home office off whenever I'm not at home. Makes sense, doesn't it? And there is plenty more you can do. But this should be something that is baked right into the OS itself. A local IFTTT if you will. Why shouldn't your computer be the control center for this? The internet of the things could start with your computer. We don't need extra gadgets for this!