https://github.com/eddex/voc-telegram-bot
Telegram bot that tells me when my room is smelly :mask:
https://github.com/eddex/voc-telegram-bot
Last synced: 12 months ago
JSON representation
Telegram bot that tells me when my room is smelly :mask:
- Host: GitHub
- URL: https://github.com/eddex/voc-telegram-bot
- Owner: eddex
- Created: 2021-01-29T16:34:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-29T18:16:59.000Z (over 5 years ago)
- Last Synced: 2025-04-29T20:56:04.448Z (about 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VOC Telegram Bot
A simple Telegram, bot that sends VOC (volatile organic compounds) and eCO2
(equivalent CO2) data from an [SGP30 Air Quality Sensor](https://www.sparkfun.com/products/16531)
to a chat.
## bot commands
### start
Sends a welcome message to the chat.
```
Hello Marco.
```
### get
Reads the VOC and eCO2 values from the sensor and returns them:
```
VOC: 12 ppb
eCO2: 402 ppm
```
## getting started
The bot needs to run on a Raspberry Pi that has an
[SGP30 Air Quality Sensor](https://www.sparkfun.com/products/16531) connected.
```bash
cd voc-telegram-bot
pip install -r requirements.txt
python3 main.py YOUR_BOT_TOKEN
```
Running the bot in a background process (e.g when connected via ssh):
```bash
# start in background
nohup python3 main.py YOUR_BOT_TOKEN &
# save pid in txt
echo $! > pid.txt
# stop background process
kill -9 `cat pid.txt`
rm pid.txt
```
## used libraries
- [Python Telegram Bot](https://python-telegram-bot.org/)
- [SGP30 Python](https://github.com/pimoroni/sgp30-python)