Controlling Lights with ESP8266 and Voice Assistants

Published by Paresh Pawar
on March 26, 2019

Many people like automation and me too. This is the tutorial in which I'll be guiding you how you can control lights using Alexa or Google Assistant.

Why use MQTT and IFTTT?

The answer to this question is quite easy, We are using this because this is a very easy and reliable method to work with. I tried to use a WEMO switch emulation with Alexa Device but due to recent firmware updates Echo devices are not able to find or discover the ESP board with WEMO emulation. so this is the way that I found easy and reliable because by doing this way you can also control your lights from a phone, any browser, Alexa enabled devices, Google Assistant, Cortana and from any corner of the world where you can reach to the Internet.

What will you need?

  • ESP8266 Development Board
  • Relay Switches (I used 4-channel Relay Board)
  • Jumper Wires
  • Arduino IDE and some libraries
  • USB power supply for ESP and Relay to operate

What do you need to do?

  1. First, install the Adafruit MQTT library into your Arduino IDE.
  2. Download code from my GitHub repository.
  3. Create an account on and
  4. Create feeds in your Adafruit dashboard and then link those feeds in IFTTT
  5. Change the code according to your needs.
  6. Complete the circuit of relays and the controller as shown in the image below
  7. change the key in the code received from Adafruit dashboard
  8. Upload your code to your controller
  9. Test if it is working correctly and check the serial output for debugging the problemsesp8266 mqtt

Where to get help?

for additional help regarding this experiment search most of your problems on Google and you will get most of the solutions there. in case you didn't found anything comment down on this article and I'll try my best to help you All the best!

Article last updated: November 6, 2023

Category: hacking


Paresh R Pawar

Phases of Ethical Hacking
December 8, 2018
Knowing the processes is very critical and impacts the lifecycle of your job/task. In Ethical H Read more...
First "Real" Trek of Life
September 29, 2022
As people say there is first time for everything. my trekking journey was started about two yea Read more...