![Screenshot](https://private-user-images.githubusercontent.com/52832301/299455225-db64049e-795c-4ed1-9700-a9a01152bbed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MjA5OTQsIm5iZiI6MTcyNDUyMDY5NCwicGF0aCI6Ii81MjgzMjMwMS8yOTk0NTUyMjUtZGI2NDA0OWUtNzk1Yy00ZWQxLTk3MDAtYTlhMDExNTJiYmVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDE3MzEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU1M2YzNzhmZGEzNzZmN2FmNGFhNjQ0ZjJmNDQyMTJlMjIyYjE3ZTlmY2EzNjA1MTE0NzZkNDkzNGRkZmI0MTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.etDzfJPp8tsU-fEOa_uY_dun_qiLhsl5u-3NKsbFNf4)
![Screenshot 2024-01-24 at 8 36 18โฏPM](https://private-user-images.githubusercontent.com/52832301/299509870-32cf06c4-b590-4fb2-bb35-21503205cbe3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MjA5OTQsIm5iZiI6MTcyNDUyMDY5NCwicGF0aCI6Ii81MjgzMjMwMS8yOTk1MDk4NzAtMzJjZjA2YzQtYjU5MC00ZmIyLWJiMzUtMjE1MDMyMDVjYmUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI0VDE3MzEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA4NjhiNzM5MTc4M2FiMjUwYjE2MmIwNWU0N2Y3YmEwNTI1N2QyYmU1MjdlZjkyNDI0MjQzOTA2ZTU0ODg2NGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ki0jlTUcaoQABcp7e6nvexKLeaaBY6DhATguuDQV7Qk)
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.