This is a bot 🤖, that watches the pot 🫖, and reminds you if you forgot 🤷♂️.
- Python 3.6 or higher 🐍
- Webcam 📷
- Computer (even a potato 🥔 with 4GB RAM should do, as long as it runs Linux 🐧)
- Coffee machine 🫖
- Coffee cup ☕️
- Propensity to forget your cup at the coffee machine 🤔
- Clone this repository with
git clone https://github.com/justinh-rahb/CoffeeBot.git
- Move the cloned repository to
/opt
withsudo mv CoffeeBot /opt
cd
into the cloned repository withcd /opt/CoffeeBot
- Install the requirements with
sudo pip3 install -r requirements.txt
- Set your environment variables by copying
.env.example
withsudo cp .env.example .env
and editing.env
with your favorite editor - Copy the systemd service file to
/etc/systemd/system
withsudo cp coffeebot.service /etc/systemd/system
- Reload the systemd daemon with
sudo systemctl daemon-reload
- Launch the bot with
sudo systemctl start coffeebot.service
The bot is configured via environment variables. You can set them in the .env
file, or directly in your shell.
Variable | Description | Default |
---|---|---|
BOT_WEBHOOK_URL | webhook URL for the bot to send messages to | none |
BOT_MESSAGE | message to send when the object is detected | Coffee cup left unattended! Please remove it from the coffee machine :) |
OBJECT | object to detect (see list: coco.names) | cup |
MIN_CONFIDENCE | minimum confidence level for object detection | 0.5 |
FRAME_SKIP | number of frames to skip before checking for object | 5 |
DETECTION_TIME | time in seconds object must be detected before sending message | 300 |
CAPTURE_DEVICE | 0 for default webcam, 1 for USB webcam | 0 |
SAVE_DIR | directory to save images | /tmp |
Your coffee machine monitoring system should be up and running, so your co-workers won't have to remind you to get your cup anymore, and you can enjoy your coffee while it's still hot.
This project is open sourced under the MIT license. See the LICENSE file for more info.