• Medium One

Using Alexa and ESP8266 WiFi to Control Your Light

Would you like a free Wifi module in this tutorial? Contact maya.madhavan@medium.one to request more information!

Introduction

In this video, you will learn how to connect Amazon’s Alexa-controlled Echo speaker to Medium One and use it for voice control interaction with a WeMos WiFi Module. You will create workflows that will allow you to turn on the WeMos LED and your light using voice commands with Alexa as well as with switches on the IoT Controller App.

For this tutorial you need:


  1. Echo Dot, Echo, or Tap

  2. Relay

  3. Lamp (or other appliance to control)

  4. Ability to solder

  5. Micro USB

  6. Wifi access (2.4GHz)

  7. Windows PC

  8. Amazon Developer account

  9. WeMos Wifi Module

  10. WeMos Windows Driver

  11. Arduino

  12. IoT Controller App


Appendix:

URL 1 : Board Manager

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Code Snippet A : Arduino Code

https://github.com/Medium-One/alexa-light-demo-esp8266/blob/master/esp8266/lightswitch.c

Code Snippet B : LED Python Workflow

https://github.com/Medium-One/alexa-light-demo-esp8266/blob/master/workflow/switch_led.py

Code Snippet C : Light Python Workflow

https://github.com/Medium-One/alexa-light-demo-esp8266/blob/master/workflow/switch_light.py

Code Snippet D : Intent Schema

{  "intents": [    {      "slots": [        {          "name": "selection",          "type": "options"        },        {          "name": "on_or_off",          "type": "on_off"        }      ],      "intent": "SensorStatusIntent"    }  ] }

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

{

"intents": [

{

"slots": [

{

"name": "selection",

"type": "options"

},

{

"name": "on_or_off",

"type": "on_off"

}

],

"intent": "SensorStatusIntent"

}

]

}

Code Snippet E : Sample Utterances

SensorStatusIntent Turn {selection} {on_or_off} SensorStatusIntent Turn {on_or_off} {selection}

1

2

SensorStatusIntent Turn {selection} {on_or_off}

SensorStatusIntent Turn {on_or_off} {selection}

URL 2 : Service Endpoint

https://assistant-sandbox.mediumone.com/alexa_request?stream=alexa

URL 3 : Authorization

https://auth-sandbox.mediumone.com/oauth2/authorize

URL 4 : Token

https://auth-sandbox.mediumone.com/oauth2/token

URL 5 : Privacy Policy

https://mediumone.com/privacy

Code Snippet F : Alexa Python Workflow

https://github.com/Medium-One/alexa-light-demo-esp8266/blob/master/workflow/light_and_led_alexa.py

4 views

© 2018 Medium One   All Rights Reserved

4633 Old Ironsides Dr. #280, Santa Clara, CA  95054                

info@mediumone.com

|

  • LinkedIn - White Circle
  • Twitter - White Circle
  • YouTube - White Circle
  • Google+ - White Circle