In Part 1 of Home Automation with Google Assistant and Alexa under $10 guide, we completed the coding and the wiring part. In this second part, we will configure the mobile app, Google Assistant and Alexa to control our DIY Home Automation device running on ESP8266 based NodeMCU.
Step 1: Setting Up Google Assistant
- Now you need to go to IFTTT and create an account if not already
- Then, click ‘New Applet’
- Click ‘this’
- Search and select ‘Google Assistant’
- Connect the Google account you using on your Android and grant access
- Enter the Phrase such as ‘Turn on the Fan’; Switch on Fan or another way to turn on the appliance (see screenshot)
- Add response from Google Assistant that you want such as ‘Turning on the Light’
- Then click ‘that‘ and choose Adafruit Feed
- Connect and authorize Adadfruit account
- Then choose Relay1
- input ON and click Create action
- Repeat the step for Turning Off and put OFF value in Relay 1
- Repeat the steps for Relay2 and Relay3
Step 2: Setting up Alexa
Alexa is bit awkward to use, as unlike Google Assistant, you need to suffix ‘Trigger’ before command ‘Turn on the lights’ instead of just saying ‘Turn on the lights.’
Use same instructions given in Step 1: just replace Google Assistant with Alexa
Step 3: Setting Up the Mobile App
- Go to Play Store, install MQTT Dash app
- Open the App and tap + icon at the top to setup MQTT broker
- Enter the details as follow:
- Name: name anything, for instance: HomeAutomation
- Address: io.adafruit.com
- Port: 1883
- Username: Enter your Adafruit username
- Password: Paste the AIO key
- Press Save icon at top right
- Now tap on the Broker name and then tap ‘+’
- Select Switch/button and then enter the details as follow:
- Name-anything
- Topic (sub): USERNAME/feeds/Relay1
- Topic (pub): USERNAME/feeds/Relay1
- Keep rest as default and then put 1 in On and 0 in Off field
- Select icons and check Retained
- Press save icon at top-right
Similarly, add temperature and humidity progress bar. Tap + icon and choose Range/Progress
- Enter name, sub and pub topic as feeds/temperature
- Enter the minimum value as 0 and Maximum as 100
- Type the suffix as *C and choose the color
- Tap retained and then tap save icon at top-right
In a similar way, you can setup Humidity. Add % as suffix and feeds/humidity as a subtopic.
That’s it. Now you can control the connected appliance with your voice as well as from your smartphone from any place in the world. All you need is an internet connection.
Hope you liked this guide and efforts made to create such content. Please share the blog post to show the appreciation/, we need it. Thanks, will be back with another interesting guide soon.
How do I use Alexa to start voice commands?
Do I need to install skill set in Alexa app?
My Alexa is not detecting the esp8266
No, you don’t have to install anything. Just install Alexa app on Android or use FireTV or Fire Stick. Configuration is done via IFTTT
Watch the video carefully to understand