Hackster is hosting Impact Spotlights: Industrial Automation. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Industrial Automation. Stream on Thursday!
Nayan Ta
Published

Automated bulb control

Google assistance to automate the control of a bulb, where a command to the google assistant will make a web request to the bolt server.

IntermediateFull instructions provided2 hours438
Automated bulb control

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Relay Module (Generic)
×1
LED Light Bulb, Frosted GLS
LED Light Bulb, Frosted GLS
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Assistant SDK
Google Assistant SDK
SmartThings service
IFTTT SmartThings service

Story

Read more

Code

Home automation

HTML
html code for light automation
<!--Change the file extension to html-->
<!DOCTYPE html>
<html lang="en">
   <head>
      <title>Bolt IoT Led Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
      <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
      <script type="text/javascript">
         // The following line will set the api key and device name. It will be auto-initialized by Bolt cloud.
         setKey('{{ApiKey}}','{{Name}}');
      </script>
   </head>
   <body>
      <div class="jumbotron vertical-center">
         <div class="container">
            <div class="row">
               <div class="col-xs-12">
                  <div  class="text-center">
                     <button type="submit" class="btn btn-success btn-xl" onclick="digitalWrite(4, 'LOW');">ON</button>
                     <br> <br> <br>
                     <button type="submit" class="btn btn-danger btn-xl" onclick="digitalWrite(4, 'HIGH');">OFF</button>
                  </div>
               </div>
            </div>
         </div>
      </div>
      <style type="text/css">
         .vertical-center {
         min-height: 100%;
         min-height: 100vh;
         display: flex;
         align-items: center;
         }
         .btn-xl {
         padding: 10px 20px;
         font-size: 20px;
         width:20%;
         }
      </style>
   </body>
</html>

Credits

Nayan Ta
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.