This repository provides a webserver for pymyq door project and the necessary setup to host it on your home internet securely. It uses dynamic dns powered by duckdns and TLS certificates(Let's Encrypt) obtained by traefik to accomplish secure communication to a home server. Allowing IFTTT or Locative or any other geofencing app to use your phone's location to automatically close your garage door when you leave.
- clone this branch
git clone https://github.com/KnicKnic/myq-garage-server.git
- cd myq-garage-server
- overlay https://github.com/KnicKnic/traefik_duckdns ontop this folder
- follow all the instructions for setting up traefik_dns
- update your username and password for docker-compose.override.yml to those in your myq app
- see the
environment
section
- see the
- update password in rules/garage.toml
- change
some_password
inrule = "PathPrefixStrip:/some_password; HostRegexp:garage.{restdomain:[\\-a-z0-9.]+}"
to some other password - ex:
rule = "PathPrefixStrip:/my_secret_password; HostRegexp:garage.{restdomain:[\\-a-z0-9.]+}"
- this serves as security to prevent others from opening and shutting your door.
- change
- start everything
docker-compose up -d --build
- issue GET web requests to your domain of the format
- https://garage.
test
.duckdns.org/some_password
/close
/Garage
test
should be the name of the duckdns subdomain you signed up forsome_password
should be the password you set in rules/garage.tomlclose
-close
andopen
are both supported to close and open the garage doorGarage
should be the "Device Name" of your door in the myq app
- https://garage.
I recommend you use any app that works with geofencing, below are some I have used on an iPhone. I prefer Locative, as it doesn't rely on a iFTTT web service. However I know iFTTT worked for me, and it works on a lot of devices, so it may be intersting to you. Send a PR or create an issue if you have a better geofencing app.
Install Locative. Add a new region that when you leave it issues a request(use url of mentioned in step 6 of "Howto use") to close.
You can setup geofencing to auto close your garage door using IFTTT when you leave an area (use location
service). You can also use IFTTT to create buttons to press on your phone (use button widget
service). For both of these you should connect it to the webhook
service. Use url of mentioned in step 6 of "Howto use", leave Method as "Get" and then click Save.
See https://www.howtogeek.com/221555/how-to-create-geographic-event-triggers-with-your-smartphone-and-ifttt/ for more info on setting up geofencing for your phone.
files | explanation |
---|---|
flask_prog.py | python webserver that calls open and close garage door |
Dockerfile | makes the container that closes and opens garage door |
docker-compose.override.yml | extends traefik_duckdns docker-compose to add this project |
rules/garage.toml | traefik config file to add webserver & expose it securely to internet |
pymyq-wrapper.py | example warpper for pymyq that is controlled via exec |
pyproject.toml | poetry project file |
poetry.lock | poetry lock file |