To make Home Automation Using NodeMCU and Alexa.
In the home automation space, Alexa can interact with several different devices. The below block diagram shows what will be developed on our project:
NodeMCU
Relay Board
Jumper Cables
Bread Board
Smartphone
Alexa
This is a powerful tool to be explored in the IoT field, where a simple voice command can trigger more complex processes using microcontrollers.
Espalexa allows you to set a range of values (e.g., Brightness, Temperature) and optionally a color, additionally to standard on/off control. For example, you can say — — “Alexa, turn the light to 75% “.
By default, it’s possible to add up to a total of 10 devices because each device “slot” occupies memory, even if no device is initialized. You can change the maximum number of devices by adding, for example:
#define ESPALEXA_MAXDEVICES 20
before calling the library:
#include <Espalexa.h>
To install the library, go to Arduino IDE Tools/Manage Libraries, and enter with espalexa:
Note: We consider that you already have an Alexa adequately installed on the same network where your NodeMcu is connected. Now, let’s ask Alexa to find your devices. There are two methods to do it: Using the Alexa App in your Smartphone asking Alexa to do it directly using voice command, like: “Alexa, discovery devices”. After 45 seconds, you should receive Alexa confirmation that seven devices were found. You can see than on the App “Light tab” as below: