In this project, we’ll create a Telegram Bot using [python-telegram-bot](https://python-telegram-bot.org/) and deploy it to Heroku. It is also programmed to control a feed on Adafruit. The program sends values of 1 and 0 to the feed and turns the status indicator on or off.

Before starting

You will have to sign up for the following services:

  • Heroku account, which is a free cloud platform
  • a Telegram account, on which we will build our bot
  • an Adafruit account

Commands

This bot takes 3 commands: /start ,/lighton and /lightoff

  • Command /start will return a message instructing the user to give the appropriate inputs
  • /lighton will display the message “Light has been turned ON”. It will also return an image of a lit bulb and will send a value to Adafruit indicating that its ON.
  • /lightoff will display the message “Light has been turned OFF”. It will also return an image of an unlit bulb and will send a value to Adafruit indicating that its OFF.

If any unknown command is given, the bot will reply with the message indicating that it hasn’t understood your command.

#adafruit #heroku #python #telegram-bot #telegram

Telegram Bot to Control a Light Bulb using Python
4.50 GEEK