fauxmoESP is a library for ESP8266/ESP32-based devices that emulates Philips Hue lights and thus allows you to control them using this protocol, in particular from Alexa-powered devices like the Amazon Echo or the Dot.
The library can be found on Xose Perez's BitBucket: fauxmoESP
The below video, shows how the project will look like at the end:
- NodeMCU ESP8266-12E
- Echo Dot (2nd Generation)
- 2 X Mini BreadBoard
- 4-Channel Relay Module
- Male-Female Dupont Cables
- External 5V power Supply
- fauxmoESP Library ZIP In order to run it in your code, you will also need 2 more libraries by Hristo Gochkov:
- ESPAsyncTCP
- ESPAsyncWebServer
Download or clone full source code from here: Source Code
So, Unzip the files and Go to your Arduino IDE and install the 3 above libraries from libraries folder under your Arduino/Library directory or Install by zip option.
Open the file NodeMCU_with_Alexa_Home_Automation.ino from my GitHub folder and change the dummy wifi credentials, with your own:
/* Network credentials */ #define WIFI_SSID "YOUR SSID HERE" #define WIFI_PASS "YOUR PASSWORD HERE"
Select your board and upload to NodeMCU board.
Let's connect a 4 Channel relay module to control 2 lamps and 2 outlets as shown in above diagram. We will create 4 "single smart devices":
- Light1 ==> Relay 1 ==> NodeMCU D5
- Light2 ==> Relay 3 ==> NodeMCU D7
- Outlet1 ==> Relay 2 ==> NodeMCU D6
- Outlet2 ==> Relay 4 ==> NodeMCU D8
and 3 groups of combined devices:
All Devices (Light1, Light2, Outlet1 and Outlet2) Living Room (Light1 and Outlet1) Bed Room (Light2 and Outlet2)
-
Xose Pérez (Thinkerman) Fauxmodeesp library development
-
Based on ALEXA - NODEMCU: WEMO EMULATION MADE SIMPLE By mjrovai
-
Image credit https://www.instructables.com
Thanks Mamun Hoque