Thanks so much for adding the per station rain sensor option. That’s great! Plus all the other fixes and updates.
It took me a while to feel confident to do the “git pull” to bring in your commits and merge them with my local changes for the garage door and rain sensor. I’m new to git. I’ve been reading a really good on-line free book, http://git-scm.com/book, which has helped me quite a bit. http://genomewiki.ucsc.edu/index.php/Resolving_merge_conflicts_in_Git also helped with understanding what I needed to do to fix the conflicts I had in ospi.py and home.js.
Since the rain sensor is functional now, I wonder if you would consider adding code to ospi.py to define the pin, set up the gpio, read the pin, and poll it.
Here’s the way I’ve done it, adding to the appropriate sections:
res2 = 0
res2 = 1
pin_rain_sense = 25
GPIO.setup(pin_rain_sense, GPIO.IN, pull_up_down=GPIO.PUD_UP)
And inserting a call to get the rain sensor state in the main loop:
def main_loop(): # Runs in a seperate thread
""" ***** Main algorithm.***** """
print 'Starting main loop n'
last_min = 0
while True: # infinite loop
gv.now = time.time()+((gv.sd/4)-12)*3600 # Current time based on UTC time from the Pi adjusted by the Time Zone setting from options. updated once per second.
Other folks might choose a different input pin for the rain sensor, but the rest of the code would be there.