Giter Site home page Giter Site logo

knicknic / myq-garage-server Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 93 KB

Configure a secure webserver to close my garage door based on geofences

License: MIT License

Dockerfile 30.57% Python 69.43%
myq-garage-door traefik docker-compose tls automation ifttt-webhooks

myq-garage-server's Introduction

Docker Image Version (latest semver)

myQ garage door server

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.

Howto use

  1. clone this branch
    1. git clone https://github.com/KnicKnic/myq-garage-server.git
    2. cd myq-garage-server
  2. overlay https://github.com/KnicKnic/traefik_duckdns ontop this folder
    1. follow all the instructions for setting up traefik_dns
  3. update your username and password for docker-compose.override.yml to those in your myq app
    1. see the environment section
  4. update password in rules/garage.toml
    1. change some_password in rule = "PathPrefixStrip:/some_password; HostRegexp:garage.{restdomain:[\\-a-z0-9.]+}" to some other password
    2. ex: rule = "PathPrefixStrip:/my_secret_password; HostRegexp:garage.{restdomain:[\\-a-z0-9.]+}"
    3. this serves as security to prevent others from opening and shutting your door.
  5. start everything docker-compose up -d --build
  6. issue GET web requests to your domain of the format
    1. https://garage.test.duckdns.org/some_password/close/Garage
      1. test should be the name of the duckdns subdomain you signed up for
      2. some_password should be the password you set in rules/garage.toml
      3. close - close and open are both supported to close and open the garage door
      4. Garage should be the "Device Name" of your door in the myq app

Enable AutoClose

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.

AutoClose via Locative

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.

AutoClose via IFTTT

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 explained

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

myq-garage-server's People

Contributors

dependabot[bot] avatar knicknic avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

linecomparison

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.