Raspberry Pi Lighting Control Web with Alexa

 

“Alexa, tell lighting control to turn the bathroom light on.”  It all started with the idea to control all my lights in my home with a raspberry pi. With some java script, python code, html and php it only took a few hours to whip out. The hardware install time took the most time.

 

First thing you will want to do is purchase your raspberry pi and an 8 channel relay board. Be sure to enable SSH on your pi.

  1. >sudo apt-get update && upgrade
  2. >git clone git://git.drogon.net/wiringPi
  3. >.cd ~/wiringPi
  4. >git pull origin
  5. >cd ~/wiringPi
  6. >./build
  7. >sudo apt-get install apache2 php5 libapache2-mod-php5
  8. Browse to the IP of your pi, you should see ” IT WORKS!” (Apache)
  9. >cd /var/www/
  10. >sudo rm index.html (remove the .html version)
  11. >sudo nano index.php (create .php version)
  12. copy this code to control pin 27,25,24,23,22,18,17,4 index.php
  13. copy this dir to your /var/www/html/ data
  14. sudo chown -R pi /var/www
  15. sudo chown -R www-data /var/www
  16. Then I followed this quide to incorperate alexa http://www.instructables.com/id/Control-Raspberry-Pi-GPIO-With-Amazon-Echo-and-Pyt/

 

 

3 thoughts on “Raspberry Pi Lighting Control Web with Alexa

Leave a Reply

Your email address will not be published. Required fields are marked *