Categoria: Uncategorized

Alexa + ESP8266 + OpenDevice

With Amazon Echo you can control your devices through voice commands. In this tutorial we will use an ESP8266, making Alexa recognize it with a compatible device, and with no configuration (incredible no?!?!).

Selection_368

For this we will use the OpenDevice library and enable the option to emulate a protocol compatible with Alexa.

The additional advantage to other similar tutorials is that we have all the benefits of OpenDevice, can connect via MQTT or receive commands via TCP

Setup:

Download and Install library: https://github.com/OpenDevice/opendevice-lib-arduino
You can all install using Arduino Library Manager.

Config:

Edit: OpenDevice/src/config.h
And uncomment  the line: #define ENABLE_ALEXA_PROTOCOL 1

Import this Sample (provided in library):
https://github.com/OpenDevice/opendevice-lib-arduino/tree/master/examples/Alexa4OpenDevice

Configure Wifi SSID and PASSWORD
NOTE: ODEV_API_KEY, is optional, only if you need integrate with OpenDevice Server

Upload and you must see in terminal:

Selection_369

Now Speak: Alexa, discover the devices
In the end, she should say that she found two devices.
Now you can talk: Alexa, turn ON the TV

This approach exposes some security issues (even disabling discovery). In a next step I will implement an Alexa Skill, which integrates with OpenDevice on the cloud (https), if you are interested, please contact me.

Anúncios