Simple HomeKit enabled Go program targeted for the Raspberry Pi platform to control garage doors connected via GPIO.
Seemed ridiculous to replace my existing garage door openers or to buy an expensive add-on just so I can have Siri open my garage door. Since I already had a Pi laying around, I figured adding a few reed switches and relays would not hurt.
- Raspberry Pi with at least 3 GPIO pins available per door you want to control
- 2 reed switches (NO)
- Some form of a relay (I use a Sain Smart relay)
This project uses dep for dependency management. You will need that installed before you can build.
$ clone this repo
$ dep ensure
$ VERSION=sem.version.number make
Use the wiring diagram below to assist you in wiring up the Pi to your relay and switches. If you are not using a Sain Smart relay, you will most likely not need the circuit documented below or will need a different circuit.
You will need to position the two reed switches in a way that the "bottom" is in a closed state when the door is in the closed position and the "top" switch is in a closed state when the door is in the open position.
Once everything is wired up, configure piragekit and run it. Launch Home on iOS and tap +, tap Add Accessory, tap "Don't Have a Code or Can't Scan?". You should see PirageKit show up as a square. Tap it and enter the code you configured earlier.
Key | Meaning |
---|---|
pin | PIN used when adding devices to Home. Global across all doors |
storage_path | Location on disk where the HomeControl database is stored. Defaults to /var/tmp/piragekit |
Key | Meaning |
---|---|
name | Name used to reference the garage door. Will show up as this name in Home |
manufacturer | Name of garage door opener manufacturer |
model | Model of garage door opener |
top_gpio | BCM GPIO pin used for the top reed switch. This is used to determine if the door is open. |
bottom_gpio | BCM GPIO pin used for the bottom reed switch. This is used to determine if the door is closed. |
relay_gpio | BCM GPIO pin used for the relay. This is used to open/close the door. |