Alexa Echo + ESP 8266 = Smart Power Plug

14,557

51

19

Introduction: Alexa Echo + ESP 8266 = Smart Power Plug

This instructable use ALEXA ECHO direct control ESP8266.

My server just support authorization ESP8266 to Amazon server.

My server do not backup your data.

Vote for me :D Thank you!

Step 1: Requirements

HARDWARE

SOFTWARE

Step 2: Flash New Frimware

1. Unplug ESP8266 from module

2.Connect module to USB to Uart module:

GND -------- | GND TX | -------- RX
------- | IO2 EN | -------- 3V3
GND ------- | IO0 RST | -------- BUTTON -------- GND
TX ------- | RX 3V3 | -------- 3V3

==================================================

BEFORE FLASH, PRESS BUTTON TO RESET
(IO0 alway connect to GND -> ESP8266 goto flash mode after reset)

==================================================

3.Flash my firmware

  • Download my sketch:

    https://github.com/kim7tin/ESP8266-Smart-Power-Plu...

  • Open in Arduino IDE, and change:
    • wifi_ssid: your wifi name
    • wifi_password: your wifi password
    • control_password: your secret password
    • friendlyName: your device name
    • ip/gateway/subnet: ESP8266 IP static for NAT
  • In Arduino IDE. Select Tool:
    • Board: Node MCU 0.9 ()
    • Upload Speed: 230400
    • Port: Select your USB to Uart port
  • Hit Upload icon (before hit, press reset button in step 2)

4.Connect ESP to module again

5.Connect power plug

Step 3: Config NAT & DDNS

We need open port (default 666) to control from Amazon server to our ESP8266.

I just illustrated with my router. You can find out how to open your router port on the internet and open TCP port 666 to the configured ip in step 2

https://m.wikihow.com/Open-Ports

if you do not have a fixed ip. You must use a dynamic domain name. You can find many free DDNS service providers.

Step 4: Control by ALEXA ECHO

1.Enable my skill named "ESP8266 Smart Power Plug

  • Alexa app > Select menu > Skill
  • Search Skill named "ESP8266 Smart Power Plug"
  • Click to Skill
  • Click ENABLE
  • Login with your Static IP or DDNS domains (include your port - default 666)

2.Discover device

  • Alexa app > Select menu > SmartHome

  • Click Add device and wait 20 seconds
  • Now you can see ESP8266

3.Control:

"Alexa, turn on/off <your ESP named in step 2>"

Voice Activated Challenge

Runner Up in the
Voice Activated Challenge

Arduino Contest 2017

Participated in the
Arduino Contest 2017

Remote Control Contest 2017

Participated in the
Remote Control Contest 2017

1 Person Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

19 Discussions

0
J.RamónL
J.RamónL

Question 10 months ago

Trying to add skill to my alexa but not available at Spain. Is it posible to take a look at your skill code. I'm trying to build a watering system using esp8266 and want to activate/deactivate watering and have enviromental data from sensors. If not posible, could you make the skill available to Spain?

0
mharmon12
mharmon12

1 year ago

This is a great demonstration!
I implemented with ESP-01 and works with Echo Dot and all of the Amazon Smart Home functionality through cell phone and web interface.

Where did you learn this from?
I would like to make changes so it refreshes the current state with Smart Home.

Great job!!!

Mike
Software Developer
Meridian, Idaho, USA
23 November 2019

0
ductin
ductin

Reply 1 year ago

Thanks Mike

0
RaulS86
RaulS86

Question 2 years ago on Introduction

is there a way to have the power cord power the relay.. like a sonoff? so you only one cord.. instead of two?

0
mharmon12
mharmon12

Answer 1 year ago

I'm guessing that is beyond the scope of this project.

0
Quajeraz
Quajeraz

Question 1 year ago

How do I set it to activate just one of the pins? i looked at your code, but I couldn't figure it out. I just want to power GI00 or Gi02, not the relay. Could you help me?

0
mharmon12
mharmon12

Answer 1 year ago

Look at the pinout for your device and then find the port for that pin in the device docs.

0
Quajeraz
Quajeraz

Question 1 year ago

Also, what am I supposed to do with the three IP address sections, right in the beggining, I was confused as to what I should replace them with.

0
mharmon12
mharmon12

Answer 1 year ago

Run IPCONFIG from the command line.
gateway = Default Gateway
subnet = Subnet Mask
ip = your ESP device. Usually, same as gateway with last digit changed.
It is assigned by your router.

0
MohandM
MohandM

2 years ago

hello, i can't find our Skill, i think it's dead :-(

0
ChristianW102
ChristianW102

Question 2 years ago on Step 4

Hi,

Good job !

Do you think it is possible to translate the skill into French? to control esp8266 in french?

Thanks

0
ductin
ductin

Answer 2 years ago

Ok, but I'm not really free now. Can you build one yourself?

0
tomsav
tomsav

Question 2 years ago

Hi

Can you use multiple ESP8266 connected to Alexa?

Does your skill support another port forwarding or only 666?

0
ductin
ductin

Answer 2 years ago

Yes, you can change to another port on arduino code

0
Stevieg1978
Stevieg1978

3 years ago

Hi this looks really good but I cannot locate the Alexa skill you refer to

0
ductin
ductin

Reply 3 years ago

It now live. You can search it now :)

0
ductin
ductin

Reply 3 years ago

I just submitted my skill. It may take a few days for you to find it.

0
ductin
ductin

Reply 3 years ago

You can edit my sketch a bit. My relay controller module via uart. With sonoff you can be direct controlled by gpio