Hi ALL
Is there a plugin to manage the GPIO ports on the raspberry PI running Homeseer ?
Thanks..Pete
Is there a plugin to manage the GPIO ports on the raspberry PI running Homeseer ?
Thanks..Pete
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
import RPi.GPIO as GPIO import time import requests sensor = 12 url = 'http://localhost:81/JSON?request=runevent&group=Sensors&name=Driveway%20Sensor' data = '' GPIO.setmode(GPIO.BCM) GPIO.setup(sensor,GPIO.IN,GPIO.PUD_DOWN) while True: time.sleep(0.2) if GPIO.input(sensor) == True: print("Driveway sensor tripped") try: response = requests.get(url, data=data) except: print("Driveway exception caught") time.sleep(15) GPIO.cleanup()
echo "Starting driveway monitor" sudo /usr/bin/python /root/driveway.py &
import RPi.GPIO as GPIO import time import requests sensor = 12 url = 'http://localhost:81/JSON?request=runevent&group=Sensors&name=Driveway%20Sensor' data = '' GPIO.setmode(GPIO.BCM) GPIO.setup(sensor,GPIO.IN,GPIO.PUD_DOWN) while True: time.sleep(0.2) if GPIO.input(sensor) == True: print("Driveway sensor tripped") try: response = requests.get(url, data=data) except: print("Driveway exception caught") time.sleep(15) GPIO.cleanup()
echo "Starting driveway monitor" sudo /usr/bin/python /root/driveway.py &
Comment