A telegram bot used to interface with Kasa devices. This is not a general purpose bot, and is made specifically to turn on or off a single Kasa plug via telegram.
You can download the windows executable from Latest Release or you can run the Python file yourself. See manual install for how.
Upon running the bot for the first time, a config.ini
file will be created. Inside are two sections KASA
and TELEGRAM
. These will need to be configured.
If you only have one Kasa plug, the bot will most likely be able to auto-discover it. If there are more than one Kasa plug, or the bot is not able to auto-discover your plug, set it's IP address at ip =
. If auto-discover is able to find more than one Kasa plug, it will list the plugs and their ip addresses when you try and run the bot without configuring.
A bot token is a string that authenticates your bot (not your account) on the bot API. Each bot has a unique token which can also be revoked at any time via @BotFather.
Obtaining a token is as simple as contacting @BotFather, issuing the /newbot command and following the steps until you're given a new token. You can find a step-by-step guide here.
Your token will look something like this:
4839574812:AAFD39kkdpWt3ywyRZergyOLMaJhac60qc
Make sure to save your token in a secure place, treat it like a password and don't share it with anyone.
Take that token, and place it in config.ini
at bot_token =
This is the number of history lines to show under the current status. 0 disables this.
- Download Python from https://www.python.org/downloads/
- Download pip from https://pip.pypa.io/en/stable/installation/
- Run
pip install -r requirements.txt
to install required libraries. - Run the python file
kasa-telegram-bot.py