mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
parent
13dc8b703d
commit
b5613fa4ff
@ -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
|
||||
|
@ -14,7 +14,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 %}
|
||||
@ -122,7 +122,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
|
||||
@ -145,6 +145,7 @@ args: "<any other text following the command>"
|
||||
from_first: "<first name of the sender>"
|
||||
from_last: "<last name of the sender>"
|
||||
user_id: "<id of the sender>"
|
||||
chat_id: "<origin 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`:
|
||||
@ -154,6 +155,7 @@ text: "some text received"
|
||||
from_first: "<first name of the sender>"
|
||||
from_last: "<last name of the sender>"
|
||||
user_id: "<id of the sender>"
|
||||
chat_id: "<origin 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:
|
||||
@ -166,6 +168,7 @@ from_last: "<last name of the sender>"
|
||||
user_id: "<id of the sender>"
|
||||
id: "<unique id of the callback>"
|
||||
chat_instance: "<chat instance>"
|
||||
chat_id: "<origin chat id>"
|
||||
```
|
||||
|
||||
### {% linkable_title Configuration samples %}
|
||||
@ -216,7 +219,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
|
||||
@ -331,7 +334,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:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user