When having a wifi controllable socket you can automatically using ifttt and smart life charge your Mac Book Pro.
- First you need to connect your smart life account with ifttt
- Then you have to create a webhook action to turn on and off your socket
- Download the battery.applescript and local.battery.plist files to your computer and load them using launchctl. More information on stackoverflow