From 285fa0163214e90dd69874f31cdd3676f074b654 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 9 Oct 2015 13:46:15 +0200 Subject: [PATCH] Add telegram page --- source/components/notify.telegram.markdown | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source/components/notify.telegram.markdown diff --git a/source/components/notify.telegram.markdown b/source/components/notify.telegram.markdown new file mode 100644 index 00000000000..be5dc5d9588 --- /dev/null +++ b/source/components/notify.telegram.markdown @@ -0,0 +1,49 @@ +--- +layout: page +title: "Telegram notification support" +description: "Instructions how to add Telegram notifications to Home Assistant." +date: 2015-10-09 18:00 +sidebar: false +comments: false +sharing: true +footer: true +--- + + +The telegram platform uses [Telegram](https://web.telegram.org) to delivery notifications from Home Assistant to your Android device, your Windows phone, or your iOS device. + +The requirement are: + +- You need a [Telegram bot](https://core.telegram.org/bots). Please follow those [instructions](https://core.telegram.org/bots#botfather) 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: + +```python +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: + +```yaml +# Example configuration.yaml entry +notify: + name: NOTIFIER_NAME + platform: telegram + # Get those by creating a new application, event, and tracker on https://instapush.im + 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 is `notify`. The notifier will bind to the service +`notify.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]({{site_root}}/components/automation.html).