Use Virtual Buttons to trigger an Alexa Routine with an ESP8266
Virtual Buttons combines an Alexa Smart Home skill with a REST API, allowing you to trigger Alex Routines with a simple REST call. To learn more about Virtual Buttons, please visit www.virtualbuttons.com
This ESP8266 example sketch uses insecure mode to contact Virtual Buttons' HTTPS endpoint. In general, using insecure mode is considered a "bad" thing. But, it is our opinion that the only thing you are risking is having someone discover your access code (that is the only "personal" data you should be passing to the API), and that is an extremely low risk. If you think someone has acquired your Virtual Buttons access code and is using it to annoyingly pushing your buttons, just disable/re-enable the skill to change your access code to something else.
Use of our example sketch assumes you have an Alexa device and an ESP8266 device setup for use with the Arduino IDE. With these things in place, your next steps are:
- Follow the instructions on www.virtualbuttons.com to enable the Virtual Buttons skill and ensure it is working for you
- Download the ESP8266_Virtual_Buttons.ino file and open it with the Arduino IDE
- Change the WIFISSID, WIFIPASS, and VBACCESSCODE defines in the ESP8266_Virtual_Buttons.ino file to match your SSID, WiFi password, and Virtual Buttons access code
- Upload the edited sketch to your ESP8266 and see if it works
- Think up all the great things you can now do with your ESP8266 and Alexa!