Fun with Alexa

November 03, 2017

Intro

I always was very interested in smart homes and controlling everything with my voice.
A while ago I did some research on different devices that could help me make my life easier.
There are some open source projects and came across Google home, and some others.
The Amazon Echo Dot was the best choice for me.
 

Buying the devices:

After Googling about the Echo Dot i found lots of possibilities that could be implemented.
I found out it was possible to connect the echo dot to some smart hubs, write your own skills and that there was a large community developing new skills every day.
Ordering the Echo dot was not that simple.
Apparently, they only ship to UK, Germany, USA. And I do not live in these countries. The Echo dot is only 45 dollars, so I needed a solution to get it to my country. There are some services that will do this for you but then it becomes expensive.
Then, I heard my college was going to New York. Bingo, shipped three echo dots to his hotel. And he brought it back home.

The development:

So now I got three echo’s in my home, and want to control my lights. Again, did some research and came across the WeMos D1 mini.
This is a wireless chip with GPIO that can be programed to emulate a smart switch that is compatible with Alexa.
This in combination with some relays I could control my lights. I ordered some WeMos D1 mini chips and relays online and got started.
The chip runs on 5v, as do the relay board, so you need a correct power source if you are planning to implement it.

 

  1. Go to www.arduino.cc and download and install the IDE.
  2. Setting up the IDE:
    1. Download and install the CH034G driver from wemos.cc
    2. Open your IDE and go to Preferences. Here you add the following url: http://arduino.esp8266.com/stable/package_esp8266com_index.json
    3. Go To Tools > Board > boardmanager, and find esp8266. Install this board.
    4. If this is done go and select the WeMos D1 mini board in Tools > Board
  3. Download the Adruino ino files and open them with your IDE.
    1. Original files
    2. My version
  4. Make your changes so its compatible with your network.
  5. Flashing the chip:
    1. Connect the WeMo chip to your usb cable
    2. Open Tools > Serial Monitor so you can follow whats going on.
    3. Click on the upload button to flash
  6. Disconnect the chip and connect your relay on the correct pins.

 

On these relays you can connect whatever you want.
Now let Alexa discover devices. You have made a smart home switch with the WeMo D1 mini chip.

 

References:

Here a chip reference of what pin is where on the chip.

 

This was again a fun project to work on. My lights are controlled by Alexa, and with the latest update i can now add routines to it.
Handy to wake up in the morning,
If you have questions, just mail me.