Alexa_Wemo[esp8266] by classdisk

This sketch is missing a short description

REF: https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch I just wanted to build a cheap switch that can be controlled by Amazon Alexa by emulating a delkin device.

You can do this using WeMos D1-mini + Relay or use SonOff

Using WeMos D1-mini + Relay

WeMos D1-mini ($4.00) http://www.aliexpress.com/store/product/D1-mini-Mini-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266/1331105_32529101036.html

WeMos Relay ($1.90) http://www.aliexpress.com/store/product/Relay-Shield-for-WeMos-D1-mini-button/1331105_32596395175.html

AC-DC HLK-PM01 module voltage 220V to 5V (Optinal) to convert 220V to 5V for D1-mini

Relay is connected to D1

To controlled this switch via Amazon Alexa.

Download the code Change the WI-FI settings. Flash Scan for new devices in Alexa Say "turn on" box

Using Sonoff

Sonoff - Thanks @joeman2116 (https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch/issues/6)

Use a ftdi 3.3v as the programmer. I tried type as a generic 1meg flash but got reboot problems. So I used the nodemcu.9 choice.

Change the ssid Change password Change device name to (your choice)

Pins I use d6 for the relay and d7 for the led.(optional)

If you want to control more than 1 switch checkout my other project https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch

Articles about the Wemos switch

monkeytypewritr

Credits

makermusings - GitHub

Developed By

Aruna Tennakoon paypal.me/arunat 3 beers from dougstrickland - Thanks 2 beers from Michael Berna 1 beer Keg from Phillip Ryals 5 beers from Steven Boger

fauxmo Emulated Belkin WeMo devices that work with the Amazon Echo

Visit this Maker Musings article to learn more about using this code to integrate the Amazon Echo with your own home automation.

Summary

The Amazon Echo will allow you to control a limited number of home automation devices by voice. If you want to control device types that it doesn't know about, or perform more sophisticated actions, the Echo doesn't provide any native options. This code emulates the Belkin WeMo devices in software, allowing you to have it appear that any number of them are on your network and to link their on and off actions to any code you want.

Instructions

All of the code to make it work is contained in the single file, fauxmo.py. It requires Python 2.7 and standard libraries. The example handler class that reacts to on and off commands uses the python-requests library, but could be replaced with code that does the same thing in many different ways.

Copy the fauxmo.py file to your server and edit the FAUXMOS list for the device names you want and the URLs to invoke for on and off commands for each one. You can execute it simply as ./fauxmo.py. If you want debug output, execute ./fauxmo.py -d. If you want it to run for an extended period, you could do something like nohup ./fauxmo.py & or take extra steps to make it run at startup, etc.

Note: unless you specify port numbers in the creation of your fauxmo objetcs, your virtual switch devices will use a different port every time you run fauxmo.py, which will make it hard for the Echo to find them. So you should plan to either leave the script running for long periods or choose fixed port numbers.

Once fauxmo.py is running, simply tell your Echo to "Find connected devices". You can also do this from the Echo App web page.

Related

http://www.makermusings.com/2015/07/13/amazon-echo-and-home-automation/ http://www.makermusings.com/2015/07/18/virtual-wemo-code-for-amazon-echo/ http://hackaday.com/2015/07/16/how-to-make-amazon-echo-control-fake-wemo-devices/ https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit https://en.wikipedia.org/wiki/Universal_Plug_and_Play http://www.makermusings.com/2015/07/19/home-automation-with-amazon-echo-apps-part-1/

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:430333" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>