A project about creating your own smart outlet which can be controlled with google assistant or basically any other input service at IFTTT.
Step 1: The Parts Needed
The parts you will need:
- Relay (I used a solid state relay)
- 5V power supply
- Project enclosure
- cable with a plug on the end
- an outlet
- some wire
You can order a lot of the part I used here: https://s.click.aliexpress.com/e/bgrqB11m
Step 2: The Wiring
Warning!!! High voltage
The schematic is quite simple but keep in mind that your wiring cables which will later on carry mains voltage so don't cheap out on heat-shrink and chose wires that can take the load. It is also a good idea to make sure you earth any exposed metal parts.
Step 3: Putting It Al Together
Place all the components in the project enclosure and wire it all together according to the schematic but don't put the lit on yet because the nodemcu still needs to be programmed.
Step 4: Programming the Nodemcu
You only have to enter your own ssid, password, adafruit IO username, and Key.
The code used is included, you only have to download the included libraries your self.
Step 5: Setting Up the Adafruit IO
First, you have to create an account for Adafruit IO after you have done that you need to open the page again and click on the actions button and create a new dashboard after you have created a new dashboard open it by clicking on it and after that click on the blue + button to create a new block you need to choose a toggle switch after you have chosen the toggle switch, enter the new feed name (Relay1). Select Relay1 and change its ON text to 1 and its OFF text to 0, click on create button and you can move on to the next step.
Step 6: Setting Up IFTTT
For IFTTT you also need to create an account after you have done that you need to create a new applet and click on +THIS and choose Google assistant as your service after that choose the first option: say a simple phrase. Fill in what you want to say to activate the outlet and click on create trigger. After that click on +THAT and select Adafruit as your service and select your feed (Relay1) and data to save will be 1. For turning the outlet off you need to create another applet which is basically the same except for the phrase to turn it off and the data to save which will be 0 to turn of the outlet.