I like to make things simple..
here is a simple way to control your ESP from across the internet without messing with too much code or slow MQTT brokers
Step 1: Parts:
1. Wemos d1 mini
2. TP Link router
3. any smartphone ( i used iphone 5c)
Step 2: Get Wemos D1 Mini Ready
1. Get Arduino IDE esp8266 extension ( there are lots of tutorials.. just google)
2. we will be using in built LED .. so no additional connections
Step 3: Upload This Code to D1 Mini
Step 4: Set Up Port Forwarding on Router
Step 5: Download Apps From Appstore on Your Phone
1. IFTTT (https://itunes.apple.com/us/app/if-by-ifttt/id660944635?mt=8)
2. speaktoit assitant (https://play.google.com/store/apps/details?id=com.speaktoit.assistant&hl=en)
Step 6: Configure the Apps
1. connect to maker channel and Assistant channel on IFTTT
2. create a IFTTT recipe
Step 7: Test It Out!
just open up the speaktoit Assistant app and say " switch On Lights of Backroom" .. there Wemos in built LED should turn on.
Piece of Cake!
no messing with MQTT code, no LAG !