1.7 KiB
1.7 KiB
layout | title | description | date | sidebar | comments | sharing | footer |
---|---|---|---|---|---|---|---|
page | Telegram notification support | Instructions how to add Telegram notifications to Home Assistant. | 2015-10-09 18:00 | false | false | true | true |

The requirement are:
- You need a Telegram bot. Please follow those instructions to create one and get the token. Keep in mind that bots are not allowed to contact users. You need to make the first contactwith your user.
- The chat ID of an user
An easy way to get your chat ID is described below:
import telegram
bot = telegram.Bot(token='YOUR_API_TOKEN')
chat_id = bot.getUpdates()[-1].message.chat_id
print(chat_id)
To enable Telegram notifications in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry
notify:
name: NOTIFIER_NAME
platform: telegram
# Get those by creating a new bot on https://core.telegram.org/bots
api_key: ABCDEFGHJKLMNOPQRSTUVXYZ
chat_id: YOUR_CHAT_ID
Configuration variables:
- name (Optional): Setting the optional parameter
name
allows multiple notifiers to be created. The default value isnotify
. The notifier will bind to the servicenotify.NOTIFIER_NAME
. - api_key (Required): The API token of your bot.
- chat_id (Required: The chat ID of your user.
To use notifications, please see the getting started with automation page.