Rpi3 GPIO Garage Door Opener Example

I am using a raspberry pi3b GPIO pins to control a relay board which simulates someone pressing the garage door opener on the wall. i tapped into the buttons on the wall and ran a pair of wires to the relayboard and connected them to common and normally open.

This tutorial assumes you have the GPIO binding installed and have already gotten that working for other items.

My config settings.

Items

Switch GPIO_GARAGE_DR_EAST "Garage Door (East)" { gpio="pin:13 force:yes activelow:yes initialValue:high" }
Switch GPIO_GARAGE_DR_WEST "Garage Door (West)" { gpio="pin:6 force:yes activelow:yes initialValue:high" }

Sitemap

    Frame label="Garage Doors" {
        Text item=GARAGEDOORS {
            Frame label="Garage Door Control" {
                Switch item=GPIO_GARAGE_DR_EAST
                Switch item=GPIO_GARAGE_DR_WEST
            }
        }
    }   

Rules
The rule here performs a momentary connection of the wires (1/2 second) which is required by my garage door opener to activate a press.

rule "pulse garage door East"
    when   
            Item GPIO_GARAGE_DR_EAST received command ON
    then   
            Thread::sleep(500)
            GPIO_GARAGE_DR_EAST.sendCommand(OFF)
    end

rule "pulse garage door West"
    when   
            Item GPIO_GARAGE_DR_WEST received command ON
    then   
            Thread::sleep(500)
            GPIO_GARAGE_DR_WEST.sendCommand(OFF)
    end

Later, I plan to add some contacts to the garage door to know the position. A camera would be great too once I can figure out the right hardware etc.

3 Likes

Nice tutorial, :+1: thanks for contributing to the forum.

If you want more info, like how far the door is open, you may want to look at a rotary encoder.:wink:

Raspberry makes a camera, not sure about the quality but worth a look.

I have a motion sensor setup in my garage that works well and its cheap.:wink:
Here’s a link if your interested.

very interesting… I’ll have to check that out. I was planning to tie into my alarm as a separate zone so that i could read it that way (open/closed), but i like that idea. Right now I am playing with my Sonoff S20 and just flashed Tasmota. going to configure my mqtt broker and give that a whirl. Lots to do!

I am looking for an IP camera, i think that would work best for me.

I mentioned it b/c sometimes we leave the garage door cracked open and it’s good to know when it’s only cracked or wide open.

See this binding to get a list of cameras that work well with OH.