A Telegram Bot that controls IOT devices on a Raspberry Pi Zero W and brings API data to the chat.
background: This project was first developed to monitor a server room’s temperature using telegram bot to receive the values. As the time didn’t help at that moment, I didn’t finish the project. But now let’s go.
Today it’s a bot with multi-functions and programmable to receive more functions.
@BotFather
on Telegram and it will give you the bot tokenRun pinout
on raspberry’s terminal to see which pin to connect - see map
of the GPIO to see the connections.
sudo apt install python3-pip
pip3 install Adafruit_DHT
pip3 install telepot
pip3 install python-dotenv
./tempsense/settg.sh
./start.sh
to begin the application, ./stop.sh
to stop and ./psaux.sh
to check if the application stopped.Now just chat with the bot or add it on a group or channel. Functions below!
I’m leaving the other files to further study, so just ignore them - or don’t.
Soon more info.
sudo cp tempsense.service /etc/systemd/system/
sudo systemctl start tempsense.service
sudo systemctl enable tempsense.service
Any change on the system, remember to modify it on the service file.
extra: /update - updates within repository
This is the transistor BC548 used to toggle 3v3 to the input of the relay.
WARNING: I don’t know why, but if you add the bot already running in a group, the code AND the bot cracks, and it stops working forever, I lost like 4 bots doing that. If you know why please contact me or send and issue or PR i dunno. Thanks a lot!