We all know that when we get into a room during night our hands will automatically go up to switch ON the lights even if we don't need it at that time and when we come out, we forget to switch it off! This causes wastage of energy, instead of saving the same! In order to control that, we can use this device to save this unwanted wastage of energy. The working of this device is that when we switch ON the light in the room, the device will send a message to the phone which is connected to Twilio account that somebody have turned ON light in the room and the buzzer will beep until you switch OFF the light.
First of all, we have to create an account in Twilio.
Create an account and get into the Dashboard.
Next, open virtualbox, vmware or ubuntu terminal to get into the coding section.
Create a file pro_conf.py(you can give your own name)to save the credentials from Twilio. It should contain
SID = 'You can find SID in your Twilio Dashboard'
AUTH_TOKEN = 'You can find on your Twilio Dashboard'
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
API_KEY = 'This is your Bolt Cloud accout API key'
DEVICE_ID = 'This is the ID of your Bolt device'
API_KEY and DEVICE_ID in the above code are the values from the Bolt cloud.
Get the API_KEY from this page.
Get the DEVICE_ID from the above page which is written as BOLTXXXXX.
Next step is to create a new file with.py extension in your terminal.Copy paste the code given below in the coding section.Remember that you have to replace my configuration file name with yours wherever I have used.
Save the file and Connect the devices according to the setup I have shown below and run the python code using python3 <your file_name>.py
That's all about the project!!!
DEMONSTRATION
Comments