Emulated Belkin WeMo device that works with Amazon Echo using MicroPython
This repository is based on makermusings/fauxmo and it was ported to work on MicroPython. This code emulates one or more Belkin WEMO type devices in software, and allows you to control them using an Amazon Echo. The code was tested on:
- ESP32 (WeMos board).
- Amazon Echo Dot (2nd Generation) - revision 1.1 should work with all the versions of Amazon Echo.
You do not need to use AWS Lambda, or ngrok or open a port on your router. Amazon Echo searches for Belkin WEMO devices on the local network and using this code the WeMos board responds to the search request. For more information, please read this article.
- WeMos (ESP32 - working on this board)
- NodeMcu Lua WIFI ESP8266 (next release -not tested yet)
- INR18650 3.7v Battery
- WS2812B LED strip
- MicroPython for ESP32
- Install MicroPython on the ESP32, you can use this tutorial;
- Modify the following lines in the
boot.py
- ssid_ =
<your ssid>
- wp2_pass =
<your wpa2 password>
- ssid_ =
- Modify the
main.py
file if you want to:- The code line
defines the WS2812 LED strip. The argumentws2812_chain = WS2812(ledNumber=ledNumber, brightness=100)
ledNumber
defines the size of the LED strip. In my case, I used 144 LEDs.- The code lines
define the devices that are going to be found by Amazon Echo. Please read this article for more information;devices = [ {"description": "white led", "port": 12340, "handler": rest_api_handler((255,255,255), 50)}, ... ]
- Upload the code to the WeMos board;
- Connect the LED strip and restart the board;
- Start a device search from Amazon Echo. You can use the Alexa application, or just say, "echo/alexa, search for new devices" and wait;
- Say, "echo/alexa, turn on the ", it should work.
- Revision: 1.1 - Code cleaned and added support for Amazon Echo (2nd Generation) using this info.
- Revision: 1.0 - Initial commit
- Check files