Skip to content

Microservice for controlling my garage door through a Raspberry Pi

License

Notifications You must be signed in to change notification settings

daviddever/CarHole

Repository files navigation

CarHole

Set of scripts Microservice for controlling my garage door from a Raspberry Pi

alt text

Wiring instructions from Idiot’s Guide to a Raspberry Pi Garage Door Opener by Chris Driscoll

Site is currently flagged for malware, link goes to Internet Archive cache.

Installation

  1. Wire up the Raspberry Pi with the guide above
  2. sudo apt-get install python-pip
  3. sudo pip install flask
  4. Copy SSL cert and key to directory or generate a self-signed one: openssl req -x509 -newkey rsa:4096 -keyout carholekey.pem -out carholecert.pem -days 3650 -nodes
  5. Edit config-example and save as config.py
  6. sudo python carhole.py

The server runs https on port 443

There is a secret key configured in config.py that must be included in application/x-www-form-urlencoded content type in each request or the request will return a Invalid Key error.

A POST request to /operate will operate the door.

A POST request to /checkdoor will return Open or Closed

Security Warning!

While this script makes efforts to operate securely, nothing is perfect and new vulnerabilites are discovered all the time, be sure to evaluate and mitigate the potential risks by blocking all, or limiting to only port 443, exposure to the Internet and apply updates to keep all components as new fixes are released.

Example of a Python script to check door status

import requests

r = requests.post('https://YOUR ADDRESS/checkdoor', data={'key':'YOUR KEY'}, verify='YOUR CERTFILE')

print r.text

Using with Home Assistant

Example script and configuration.yaml files for using in conjunction with Home Assistant are included in ./homeassistant

Stand Alone Scripts

These scripts can be run from the shell independently of carhole.py

checkdoor.py

Checks state of door, returns Open or Closed

useedoor.py

Operates the door

tasker.xml

Task to import into Tasker to operate the door

About

Microservice for controlling my garage door through a Raspberry Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages