A simple hack, to remotely open a garage.
This code is a Discord bot that allows you to control a garage door using a Raspberry Pi. When the bot receives a message, it will attempt to open the garage door by triggering a low signal on the specified output pin for 1 second and then returning it to a high signal.
-
Get a Raspberry pi and install a simple OS. I'm using Ubuntu
-
Connect the output pin specified in the
OUTPUT_PIN
variable to your garage door opener circuit -
Create a Discord bot (see this on how to create a bot)
-
Clone the project somewhere
-
Create a
.env
file in the root directory of the project and set theDISCORD_TOKEN
environment variable to your Discord bot's token.DISCORD_TOKEN=<discord bot token>
-
Run the script with
python3 main.py
and test by sending any message to the bot -
Install as systemd service
sudo nano /etc/systemd/system/garage.service
add the content of the
garage.service
file to the file and save itsudo systemctl daemon-reload sudo systemctl enable garage sudo systemctl start garage