From b871b2b999bb22931921e3b5d98c1795bac935c8 Mon Sep 17 00:00:00 2001 From: Eugenio Panadero Date: Mon, 22 May 2017 08:41:04 +0200 Subject: [PATCH] fix links, add new data from #7689, change example config (#2677) --- source/_components/notify.telegram.markdown | 2 +- source/_components/telegram_bot.markdown | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/_components/notify.telegram.markdown b/source/_components/notify.telegram.markdown index 5afe840e143..74e8cf8d754 100644 --- a/source/_components/notify.telegram.markdown +++ b/source/_components/notify.telegram.markdown @@ -48,7 +48,7 @@ To enable Telegram notifications in your installation, add the following to your ```yaml # Example configuration.yaml entry for the Telegram Bot telegram_bot: - platform: webhooks + platform: polling api_key: ABCDEFGHJKLMNOPQRSTUVXYZ allowed_chat_ids: - CHAT_ID_1 diff --git a/source/_components/telegram_bot.markdown b/source/_components/telegram_bot.markdown index 0f213b192d6..49b770f7606 100644 --- a/source/_components/telegram_bot.markdown +++ b/source/_components/telegram_bot.markdown @@ -13,7 +13,7 @@ ha_release: 0.42 Use Telegram on your mobile or desktop device to send and receive messages or commands to/from your Home Assistant. -This component creates notification services to send, or edit previously sent, messages from a [Telegram Bot account](https://core.telegram.org/bots) configured either with the [polling](/_components/telegram_bot.polling.markdown) method or with the [webhooks](/_components/telegram_bot.webhooks.markdown) one, and trigger events when receiving messages. +This component creates notification services to send, or edit previously sent, messages from a [Telegram Bot account](https://core.telegram.org/bots) configured either with the [polling](/components/telegram_bot.polling/) method or with the [webhooks](/components/telegram_bot.webhooks/) one, and trigger events when receiving messages. ### {% linkable_title Notification services %} @@ -121,7 +121,7 @@ Respond to a callback query originated by clicking on an online keyboard button. ### {% linkable_title `Telegram` notification platform %} -The [Telegram notification platform](/_components/notify.telegram.markdown) requires the `telegram_bot` component to work with, and it's designed to generate a customised shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. +The [Telegram notification platform](/components/notify.telegram/) requires the `telegram_bot` component to work with, and it's designed to generate a customised shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. The required yaml configuration now reduces to: ```yaml @@ -144,6 +144,7 @@ args: "" from_first: "" from_last: "" user_id: "" +chat_id: "" ``` Any other message not starting with `/` will be processed as simple text, firing a `telegram_text` event on the event bus with the following `event_data`: @@ -153,6 +154,7 @@ text: "some text received" from_first: "" from_last: "" user_id: "" +chat_id: "" ``` if the message is sent from a [press from an inline button](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating), for example, a callback query is received, and Home Assistant will fire a `telegram_callback` event with: @@ -165,6 +167,7 @@ from_last: "" user_id: "" id: "" chat_instance: "" +chat_id: "" ``` ### {% linkable_title Configuration samples %} @@ -215,7 +218,7 @@ trigger: action: - service: homeassistant.turn_on entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 - - delay: + - delay: seconds: 10 - service: homeassistant.turn_off entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0 @@ -330,7 +333,7 @@ Only acknowledges the 'NO' answer: message: 'OK, you said no!' ``` -For a more complex usage of the `telegram_bot` capabilities, using [AppDaemon](https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/) is advised. +For a more complex usage of the `telegram_bot` capabilities, using [AppDaemon](/docs/ecosystem/appdaemon/tutorial/) is advised. This is how the previous 4 automations would be through a simple AppDaemon app: