Announcement

Collapse
No announcement yet.

GPIO port

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GPIO port

    Hi ALL

    Is there a plugin to manage the GPIO ports on the raspberry PI running Homeseer ?

    Thanks..Pete
    HS 2.2.0.11

    #2
    I'm also looking for a way to access the gpio ports on the pi


    Sent from my iPhone using Tapatalk

    Comment


      #3
      I'm using GPIO pins on a Zee S2 to detect dry contact closure from a driveway sensor. I didn't really want to mess with a plugin, so I wrote a short Python script that detects contact closure and runs an event through the JSON interface.

      driveway.py
      Code:
      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()
      I run the script in the background from /etc/rc.local before starting HomeSeer.
      Code:
      echo "Starting driveway monitor"
      sudo /usr/bin/python /root/driveway.py &
      HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
      Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
      Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
      Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.

      Comment


        #4
        Nice. I saw another post in which you mentioned the driveway sensor connected to the pi and wondered how..
        Originally posted by reidfo View Post
        I'm using GPIO pins on a Zee S2 to detect dry contact closure from a driveway sensor. I didn't really want to mess with a plugin, so I wrote a short Python script that detects contact closure and runs an event through the JSON interface.



        driveway.py

        Code:
        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()


        I run the script in the background from /etc/rc.local before starting HomeSeer.

        Code:
        echo "Starting driveway monitor"
        
        sudo /usr/bin/python /root/driveway.py &




        Sent from my iPhone
        Tom
        baby steps...starting again with HS3
        HS3Pro: Z-NET & 80 Z wave Devices,
        HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
        Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
        In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
        System: XP on Fanless Mini-ITX w/ SSD

        Comment


          #5
          I'll try that, looks good.



          Sent from my iPhone using Tapatalk

          Comment

          Working...
          X