OpenSprinkler › Forums › Comments, Suggestions, Requests › Garage door monitoring and control › Re: Re: Garage door monitoring and control
another update… Garage status code
This is all air code since I don’t have the OSpi yet, but I had a few minutes to kill this morning – so here goes. Since RPi.GPIO is being used by the interval program anyway, I should be able to connect a reed sensor directly to the RPi’s GPIO pins. If so, could I use the recently added ospi_addon.py functionality to get the status of the reed switch? Here’s an example (python is pretty far from my native programming language!):
#### Add any new page urls here ####
"""Return a page containing the status of garage door sensor"""
custpg = 'n'
door1_pin = 23
custpg += 'TRUE'
custpg += 'FALSE'
I just want to be able to use an HTTP command to find out if the door is open or closed. This would need to be expanded to handle multiple door sensors.