Jayasurya Karadi
Published © GPL3+

Home Automation using Google Assistant and Bolt App

This project is about Home Automation where you can control the lights of each room using Google-Assistant or by using Bolt App.

IntermediateFull instructions provided2 hours837
Home Automation using Google Assistant and Bolt App

Things used in this project

Hardware components

LED (generic)
LED (generic)
You and connect as may led as u need. Just make a proper connection
×2
Resistor 330 ohm
Resistor 330 ohm
As the use of led increases resistors also increases
×2
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Breadboard (generic)
Breadboard (generic)
×1
Connecting Wires
×6

Software apps and online services

Assistant SDK
Google Assistant SDK
Maker service
IFTTT Maker service
Bolt Cloud
Bolt IoT Bolt Cloud
Bolt IoT Android App
Bolt IoT Android App

Story

Read more

Schematics

Connections:

Complete explanation of circuit connect is shown in above video find it if your don't understand.
I have connected 2 LED's each naming room 1 and room 2. First LED of +ve pin is connected to pin 0 of GPIO and 2nd LED of +ve pin is connected to pin 1 of GPIO. Its a simple connection of LED's in serial. Each LED's -ve pin are connected to 330 ohm resistor and another pin of resistor is connected to GND

LED

LED Connection

Code

Bolt App

HTML
Using Bolt App
Here I have used HTML, JS and CSS to make a perfect page and interface
--------------------------------------------
<style>This refers to CSS
background-color=changes background color of the button
border=I don't need border that's why I made"none"
border-radius= make your bottom round as per radius you give
color= font color
padding= giving spacing "20px"-top and bottom, "47px"- left and right
text-align= make the cent to display at the center of the screen
text-decoration=removing bullets or making text simple
display:inline-block it make to display one after the other
font-size: size of the font
margin: margin of the page
cursor: pointer means its shows which option you have selected
<!DOCTYPE html>
<html>
    <head>
        <title>Bolt IoT Platform</title>
        <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
        <script>
        setKey('{{ApiKey}}','{{Name}}');
        </script>
        <style>
            .onbutton{ 
                background-color: #4CAF50;
                border:none;
                border-radius: 30px;
                color: white;
                padding: 20px 47px;
                text-align: center;
                text-decoration: none;
                display: inline-block;
                font-size: 20px;
                margin: 4px 2px;
                cursor: pointer;
            }
            .offbutton{
                background-color: red;
                border:none;
                border-radius: 30px;
                color: white;
                padding: 20px 47px;
                text-align: center;
                text-decoration: none;
                display: inline-block;
                font-size: 20px;
                margin: 4px 2px;
                cursor: pointer;
                
            }
        </style>
    </head>
    <body>
        <br><br><br><br><br><br><br><br><br><br><br>
        <center>
            <h3>Room: 1</h3>
        <button class="onbutton" onclick="digitalWrite(0, 'HIGH');">ON</button>
        <button class="offbutton" onclick="digitalWrite(0, 'LOW');">OFF</button>
        <br><br>
        <h3>Room: 2</h3>
        <button class="onbutton" onclick="digitalWrite(1, 'HIGH');">ON</button>
        <button class="offbutton"onclick="digitalWrite(1, 'LOW');">OFF</button>
        </center>
    </body>
</html>

Google Assistant

ActionScript
Save this code as .js in the bolt cloud
copy all the url and paste in bolt cloud code scection
Using Google Assistant to Control the Room
Here I have used IFTTT to link the project with Google-Assistant.
1. You need to login ifttt.com and create an account and click on dashboard->Create
2. Click the "+" sign in the page and search for Google Assistant and select it
3. Choose a trigger called "Say a simple phase"
4. Give a command how to access the voice command and save it
5. You can see "+" option after following the above steps and search for "Webhooks" and select it
6. Choose a action called "make a action"
7. Later that use the URL provided in the code section and paste the URL in webooks
NOTE: Make sure that you have changed the url by placing your API key instead of "yourAPIKEY" and Bolt ID instead of "yourBOLTID" in the URL given
8. method->GET
9.Content Type->application/json and save it
8. For each command you use create new applets in IFTTT
9. If you have doubts see the steps section.
<!--led room1-->
https://cloud.boltiot.com/remote/yourAPIKEY/digitalWrite?pin=0&state=HIGH&deviceName=yourBOLTID
https://cloud.boltiot.com/remote/yourAPIKEY/digitalWrite?pin=0&state=LOW&deviceName=yourBOLTID



<!--led room2-->
https://cloud.boltiot.com/remote/yourAPIKEY/digitalWrite?pin=1&state=HIGH&deviceName=yourBOLTID
https://cloud.boltiot.com/remote/yourAPIKEY/digitalWrite?pin=1&state=LOW&deviceName=yourBOLTID

Credits

Jayasurya Karadi
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.