Ever since I have heard the concept of smart lights, I find it really fascinating that we can actually control the lights by our voice. So, after knowing this even I wanted to make something of my own so I google searched and I came across this blog of Team Nitro and then I decided to proceed.
So this project is the same as this blog. Now I can control the lights from anywhere anytime because all I need is my mobile phone and internet connection.
Step 1: Hardware SetupInsert longer end of LED to pin 0 of Bolt iot wifi module or any pin you wish to and insert shorter end of LED to gnd pin(i.e. Ground pin), and power ON the wifi module.
Step 2: Getting the Bolt API Key and Device IDLogin to Boltiot Cloud and note the device id of your device from the device tab which will be something like BOLTXXXXXXX.
Now go to API tab and in the generate key section enable the API key and copy the API key
Your API key will may look something like this: 4cd780ed-75db-4047-8880-90f48259ea01
Step 3: Create the GPIO Control CommandAs LED is a digital output device, we will need a Digital Write command that we will send to Bolt over the Internet to switch-ON the LED.
Click to Docs Tab in your Bolt cloud -> API Documentation -> GPIO Commands API -> Write Digital Output
The syntax of the command is:
https://cloud.boltiot.com/remote/API_KEY/digitalWrite?pin=PIN_NUMBER&state=HIGH/LOW&deviceName=DEVICE_ID
The parameters that you need to replace are:API_KEY: Get it by clicking on API key tab on your cloud dashboard.PIN_NUMBER: Pin that is connected to the LED. It can be from 0-4.HIGH/LOW: Setting state = HIGH will turn LED ON, setting state = LOW will turn LED OFF.DEVICE_ID: This is the id of your device. Get it from cloud dashboard.
The sample command to turn the LED ON connected to device having ID BOLT14487064 to PIN 0 is:
https://cloud.boltiot.com/remote/4cd780ed-75db-4047-8880-90f48259ea01/digitalWrite?pin=0&state=HIGH&deviceName=BOLT14487064
** NOTE : Make sure you change the API key to your API key and the pin that you have inserted your longer end of LED (in this case pin=0).
Step 4: IFTTT integration via Google Assistant and WebhooksGot to IFTTT
Click If This (+) :
Choose service as Google Assitant :
Choose "Say specific phrase" :
Type the phrase you want to trigger the action. Make sure to specify the trigger command in different ways for example I used
a) Turn the lights on
b) Turn on the lights
c) Lights on
Click on 'Create Trigger'
Now select "Then that " Add:
Choose service as webhooks :
Next step is :
Now in the complete action field :
Enter the API URL you got in the previous Step. (Note : change the API Key and device name as your own )
Method - GET
Content type - Application/json
Click on Create action and then on finish.
Now repeat the same steps for lights Off but in the URL instead of state = HIGH, state = LOW will come.
YAYYYYYY!!! Congratulations itsdone.
You have made your own smart light using google assistant.
ConclusionThis project is easy to setup and can be accesed from anywhere, you just need to have your own mobile and internet connectivity. And also a non-technical person can build this project easily and succesfully






Comments