Home Automation with Google Assistant and Alexa under $10 (PART 2)

In Part 1 of the guide, we completed the coding and the wiring part. In this second part of Home Automation with Google Assistant and Alexa under $10, 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

New Applet

  • Then, click ‘New Applet’
  • Click ‘this’

If This

  • Search and select ‘Google Assistant’

Select googel Assistant

  • Connect the Google account you using on your Android and grant access

Connect Google Account

  • Enter the Phrase such as ‘Turn on the Fan’; Switch on Fan or another way to turn on the appliance (see screenshot)

Choose TriggerTurn On Fan

  • Add response from Google Assistant that you want such as ‘Turning on the Light’
  • Then click ‘that‘ and choose Adafruit Feed

Than That

  • Connect and authorize Adadfruit account

IFTTT Adafruit

Adafruit connect

  • Then choose Relay1

Choose Relay

  • 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.’

Choose AlexaAlexa Trigger created

Use same instructions given in Step 1: just replace Google Assistant with Alexa

Applet RAN

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

Click + to create new dashboard

  • 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

Create Dashboard-Add name username and PasswordCreate Dashboard add adafruit AIO key as password

  • Press Save icon at top right
  • Now tap on the Broker name and then tap ‘+’

Choose Switch from the list to control adafruit relay - Copy

  • 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

Add feed url and relay choose ICon of wifi relay controlSelect Icon for MQTT Wifi light IoTList of ICons to choose from

  • Press save icon at top-right

Similarly, add temperature and humidity progress bar. Tap + icon and choose Range/Progress

Choose Switch from the list to control adafruit relay

  • 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

Add Temperature Feed to see room temperature iot Add suffix and prefix for Temperature value

In a similar way, you can setup Humidity. Add % as suffix and feeds/humidity as a subtopic.Add Humidity Add suffix percentage sign for Humidity monitor IoT

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.After adding 3 wifi relay control and Humidity Temperature sensor for remote monitoring

MQTT Dashboard after adding all WiFi Relay IoT control and Room environment monitor

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.