Do not worry about wasting electricity if you forget to switch off the lights. This project will help you to control the lights with the help of google assistant. To control your lights at your home you just need a phone and a good internet connectivity.
Follow these simple steps to create one for you:
Step 1: Hardware configurationTake your LED and Bolt Wi-Fi Module. Insert +ve(longer) end of the LED into pin 0 (You can insert it into any of the GPIO Pins of your Bolt Wi-Fi Module i.e. Pin 0, 1, 2, 3 or 4. I'm using Pin 0 as it is closest to the ground(GND) Pin) and insert -ve(shorter) end of the LED to ground(GND) pin.
Connect USB cable to the device and plug it through any power supply. Make sure your device is online(i.e. blue and green LED of your Bolt device is ON)
Login into your Bolt cloud account https://cloud.boltiot.com/
Note down the ID of your device which you can find it on your dashboard.
On the left side of the screen click on API tab and copy your API Key.
Save it for further use.
Step 3: GPIO Control command for turning LED on and offwhere,
- API_KEY = Your API Key which you have copied from API tab
- PIN_NUMBER = Pin number to which you have connected the LED(i.e., 0 here)
- HIGH/LOW = Choose 'HIGH' to turn on the light and 'LOW' to turn off the light
- DEVICE_ID = Replace the DEVICE_ID by ID which you copied from the dashboard in the previous section.
1. Go to https://ifttt.com to create a new applet
2. Login using your Gmail account if you already have an account there. (Make sure you use same account which you will be using on your mobile to interact with Google assistant). If you don't have an account then signup.
3. Click on 'Add' for the 'If This' option and choose the service google assistant.
4. Choose "Say a Simple Phrase".
5. Type the phrase you want to say to Google to turn on the light
6. Type the phrase you want google to respond you and then click on "Create Trigger".
7. Again click on 'Add' for 'Then That' and select a service as webhooks. The screenshot for the same is attached below.
8. Click on "Make a web request".
Enter API URL you got in previous step which contain your own parameters.
Choose "GET" in the method and "application/json" in the content type.
Click on 'Create action' and click on 'Finish'.
Steps to turn off the LED
The only change that has to be made for turning off LED is to change the state to 'LOW' in your URL and a suitable phrase in the webhooks. All other steps are similar as stated above.
URL may look similar to this:
That's it! We are done!
Now lets wake our android phone by saying "Ok Google" and say the phrase we had set while creating the trigger.
Thank You.
Comments
Please log in or sign up to comment.