/uPyEcho

Emulated Belkin WeMo device that works with Amazon Echo (Alexa) using MicroPython on an ESP32

Primary LanguagePythonApache License 2.0Apache-2.0

uPyEcho

Emulated Belkin WeMo device that works with Amazon Echo using MicroPython

About the repository

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.

Video

PoC

Requirements

Instructions

  • 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>
  • Modify the main.py file if you want to:
    • The code line
    ws2812_chain =  WS2812(ledNumber=ledNumber, brightness=100)
    defines the WS2812 LED strip. The argument ledNumber defines the size of the LED strip. In my case, I used 144 LEDs.
    • The code lines
      devices = [
          {"description": "white led",
           "port": 12340,
           "handler": rest_api_handler((255,255,255), 50)},
           ... ]
    define the devices that are going to be found by Amazon Echo. Please read this article for more information;
  • 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.

Changelog

  • Revision: 1.1 - Code cleaned and added support for Amazon Echo (2nd Generation) using this info.
  • Revision: 1.0 - Initial commit

License

  • Check files

Credits

More Info: