Salman Faris
Published © Apache-2.0

Raspberry Pi & Azure Based Home Automation

You will be able to control any appliance in your home from anywhere around the world when your done with this Raspberry Pi home automation.

IntermediateFull instructions provided1 hour6,503
Raspberry Pi & Azure  Based Home Automation

Things used in this project

Story

Read more

Schematics

How They Works.

Code

rasbpi.py

Python
import RPi.GPIO as GPIO
import urllib2
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(5,GPIO.OUT)
true = 1
while(true):
                try:
                        response = urllib2.urlopen('http://salfarsmarthome.azurewebsites.net/buttonStatus.php') 
                        status = response.read()
                except urllib2.HTTPError, e:
                                        print e.code

                except urllib2.URLError, e:
                                        print e.args

                print status
                if status=='ON':
                                GPIO.output(5,True)
                elif status=='OFF':
                                GPIO.output(5,False)

Credits

Salman Faris

Salman Faris

26 projects • 417 followers
Maker | Hardware Hacker | Electronics Enthusiast

Comments